summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2020-04-26Userland: Fix kill to support negative pid values.Brian Gianforcaro
The kill system call accepts negative pids, as they have special meaning: pid == -1 means all processes the calling process has access to. pid < -1 means every process who's process group ID is -pid. I don't see any reason why the user space program should mask this.
2020-04-25LibJS: Stop using Optional<Value> in favor of Value's empty stateAndreas Kling
JS::Value already has the empty state ({} or Value() gives you one.) Use this instead of wrapping Value in Optional in some places. I've also added Value::value_or(Value) so you can easily provide a fallback value when one is not present.
2020-04-25 Userland/ls: Remove unnecessary outputHüseyin ASLITÜRK
2020-04-24js: Interrupt running script or REPL evaluation when receiving SIGINTLinus Groh
2020-04-24LibJS: Add TokenType::TemplateLiteralLinus Groh
This is required for template literals - we're not quite there yet, but at least the parser can now tell us when this token is encountered - currently this yields "Unexpected token Invalid". Not really helpful. The character is a "backtick", but as we already have TokenType::{StringLiteral,RegexLiteral} this seemed like a fitting name. This also enables syntax highlighting for template literals in the js REPL and LibGUI's JSSyntaxHighlighter.
2020-04-21LibGUI: Make MenuBar a Core::ObjectAndreas Kling
This makes it show up in Inspector with all the menus inside it. :^)
2020-04-19Userland: Remove some little temporary test programsAndreas Kling
These were never meant to stick around.
2020-04-19Kernel: rmdir("/") should fail instead of assertingAndreas Kling
We can't assume there's always a parent custody -- when we open "/" there isn't gonna be one! Fixes #1858.
2020-04-19test_io: Unbreak symlink test after sys$readlink() '\0' changesAndreas Kling
2020-04-19LibLine: Allow suggestions to have trailing trivia stringsAnotherTest
These strings would be applied when inserted into the buffer, but are not shown as part of the suggestion. This commit also patches up Userland/js and Shell to use this functionality
2020-04-19Userland: Add open(1)Sergey Bugaev
This is a simple utility for invoking Core::DesktopServices::open() from command line :^)
2020-04-18LibJS: Move builtin prototypes to the global objectAndreas Kling
This moves us towards being able to run JavaScript in different global objects without allocating a separate GC heap.
2020-04-16js: Tweak the live syntax highlighting colors a bitAndreas Kling
2020-04-16functrace: Log syscallsItamar
2020-04-16Userland: Add "functrace" utilityItamar
functrace traces the function calls a program makes. It's like strace, but for userspace. It works by using Debugging functionality to insert breakpoints at call&ret instructions.
2020-04-15js: Tweak colorization of printed values a bitAndreas Kling
2020-04-14Kernel: Don't include null terminator in sys$readlink() resultSergey Bugaev
POSIX says, "Conforming applications should not assume that the returned contents of the symbolic link are null-terminated." If we do include the null terminator into the returning string, Python believes it to actually be a part of the returned name, and gets unhappy about that later. This suggests other systems Python runs in don't include it, so let's do that too. Also, make our userspace support non-null-terminated realpath().
2020-04-14js/LibJS: Move test functions to pure javascript.Brian Gianforcaro
The addition of assert functions to Userland/js was done before we had load(..) implemented. Now that it exists, it seems like the right move the test helper functions to pure javascript instead of poluting js with random global functions.
2020-04-13js: Output text using printf() and return undefined in help()Linus Groh
2020-04-13js: Add assertNotReached() function in test modeLinus Groh
2020-04-13LibJS: Do not execute scripts with parse errorsStephan Unverwerth
This adds missing checks in several LibJS consumers.
2020-04-13js: Make load() available when running with --test-modeBrian Gianforcaro
The work I did to add assert as a native function in js was a step in the wrong direction. Now that js supports load() it makes sense to just move assert and anything we want to add to the test harness into pure javascript.
2020-04-13strace: Update ptrace() usageItamar
ptrace with PT_TRACEME was updated to also stop the traced thread on exit from execve.
2020-04-13js: Coerce assert() argument to booleanLinus Groh
It's JavaScript after all :^)
2020-04-11js: Stylize TokenType::{Throw,Switch,Case}Linus Groh
2020-04-11LibLine: Display suggestions and cycle between themAnotherTest
With extra color (tm) This commit also patches the users of LibLine to properly use the new API
2020-04-11Userland: Add primitive autocomplete to the JS replAnotherTest
This patch adds primitive support for autocompletion in the JS repl, it only supports completing global names and properties on variables :^)
2020-04-11Userland: Install LibLine's signal handlers in the JS replAnotherTest
2020-04-11LibX86: Run the instruction decoder in 32-bit mode by defaultAndreas Kling
Let's assume a 32-bit execution environment unless otherwise specified.
2020-04-11LibX86: Add an X86 instruction decoder library + basic disassemblerAndreas Kling
This will be very useful for developer tools like ProfileView, and also for future tools like debuggers and such. :^)
2020-04-10JS repl: Fix indentation when a line starts with '})]'AnotherTest
2020-04-09LibJS: Add globalThisLinus Groh
We already have "global" as a way to access the global object in js(1) (both REPL and script mode). This replaces it with "globalThis", which is available in all environments, not just js.
2020-04-08LibJS: Handle empty values in Value::to_string()Linus Groh
2020-04-06LibJS: Support array holes, encoded as empty JS::ValueAndreas Kling
This patch adds a new kind of JS::Value, the empty value. It's what you get when you do JSValue() (or most commonly, {} in C++.) An empty Value signifies the absence of a value, and should never be visible to JavaScript itself. As of right now, it's used for array holes and as a return value when an exception has been thrown and we just want to unwind. This patch is a bit of a mess as I had to fix a whole bunch of code that was relying on JSValue() being undefined, etc.
2020-04-06LibJS: Add a number-indexed property storage to all ObjectsAndreas Kling
Objects can have both named and indexed properties. Previously we kept all property names as strings. This patch separates named and indexed properties and splits them between Object::m_storage and m_elements. This allows us to do much faster array-style access using numeric indices. It also makes the Array class much less special, since all Objects now have number-indexed storage. :^)
2020-04-06Kernel & Userland: Allow to mount image files formatted with Ext2FSLiav A
2020-04-06Meta: Add missing copyright headersAndreas Kling
2020-04-05JS Repl: Add live syntax highlightingAnotherTest
This patchset adds live syntax highlighting to the js repl. It is turned off by default and can be enabled via the -s flag.
2020-04-05js: Add a new --test-mode option, which exposes an assert() function.Brian Gianforcaro
Introduce a central assert implementation so that the LibJS test suite can take advantage of one implementation instead of copy/pasting the same function into every test case file.
2020-04-05Kernel: Add the SO_BINDTODEVICE socket optionAnotherTest
This patch adds a way for a socket to ask to be routed through a specific interface. Currently, this option only applies to sending, however, it should also apply to receiving...somehow :^)
2020-04-05js: Add lines to historyLinus Groh
2020-04-04LibJS: Don't return the "last computed value" from Interpreter::run()Andreas Kling
Only return whatever a "return" statment told us to return. The last computed value is now available in Interpreter::last_value() instead, where the REPL can pick it up.
2020-04-04ProtocolServer+LibProtocol: Reject unhandled URLs instead of assertingAndreas Kling
StartDownload requests for unhandled protocols (or invalid URLs) will now refuse to load instead of asserting. A failure code is sent back to LibProtocol and Protocol::Client::start_download() returns nullptr. Fixes #1604.
2020-04-04Userland: Fix null-pointer deref on unknown user/group in chown/chgrpAndreas Kling
We can't just blindly dereference the result of getpwnam()/getgrnam()! Fixes #1625.
2020-04-04LibJS: Set length property in Object::put_native_function()Linus Groh
2020-04-04LibGUI: Add MenuBar::add_menu(name)Andreas Kling
This allows us to construct menus in a more natural way: auto& file_menu = menubar->add_menu("File"); file_menu.add_action(...); Instead of the old way: auto file_menu = GUI::Menu::construct(); file_menu->add_action(...); menubar->add_menu(file_menu);
2020-04-04LibJS: Add js_string(Interpreter&, String)Andreas Kling
2020-04-04js: Return 1 after exception in non-REPL modeLinus Groh
2020-04-04Userland/JS: Add the 'save("file")' repl commandDov Alperin
Calling save("file") in a repl saves all the typed lines so far into the specified file. It currently does not have great support for multilined functions since those get turned into one line.
2020-04-03Revert "Kernel & Userland: Allow to mount image files formatted with Ext2FS"Andreas Kling
This reverts commit a60ea79a41845767ce40f225de20da7c99534ad1. Reverting these changes since they broke things. Fixes #1608.