summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-07-03Everywhere: Use IPC include syntaxTimothy
Remove superfluous includes from IPCCompiler's generated output and add include directives in IPC definitions where appropriate.
2021-07-03IPCCompiler: Add include parsing for endpointsTimothy
This will find all lines at the start of the file beginning with # and copy them straight through.
2021-07-033DFileViewer: Add primitive mouse controlsNoah Rosamilia
2021-07-03LibJS: Don't allow `delete super.property`Andreas Kling
This should throw a ReferenceError, since `delete` is not allowed on super references.
2021-07-03LibJS: Bring the `super` keyword in line with the specAndreas Kling
This patch implements spec-compliant runtime semantics for the following constructs: - super.property - super[property] The MakeSuperPropertyReference AO is added to support this. :^)
2021-07-03Everywhere: Fix some alignment issuesDaniel Bertalan
When creating uninitialized storage for variables, we need to make sure that the alignment is correct. Fixes a KUBSAN failure when running kernels compiled with Clang. In `Syscalls/socket.cpp`, we can simply use local variables, as `sockaddr_un` is a POD type. Along with moving the `alignas` specifier to the correct member, `AK::Optional`'s internal buffer has been made non-zeroed by default. GCC emitted bogus uninitialized memory access warnings, so we now use `__builtin_launder` to tell the compiler that we know what we are doing. This might disable some optimizations, but judging by how GCC failed to notice that the memory's initialization is dependent on `m_has_value`, I'm not sure that's a bad thing.
2021-07-03LibC: Don't use C++ attribute syntax in C-visible headersDaniel Bertalan
Fixes errors when building Clang's compiler-rt, which compiles in C11 more.
2021-07-02LibJS: Improve ResolveBinding + add GetIdentifierReferenceAndreas Kling
ResolveBinding now matches the spec, while the non-conforming parts are moved to GetIdentifierReference. Implementing this properly requires variable bindings.
2021-07-02AK: Implement String::find_any_of() and StringView::find_any_of()Max Wipfli
This implements StringUtils::find_any_of() and uses it in String::find_any_of() and StringView::find_any_of(). All uses of find_{first,last}_of have been replaced with find_any_of(), find() or find_last(). find_{first,last}_of have subsequently been removed.
2021-07-02AK+Everywhere: Remove StringView::find_{first,last}_of(char) methodsMax Wipfli
This removes StringView::find_first_of(char) and find_last_of(char) and replaces all its usages with find and find_last respectively. This is because those two methods are functionally equivalent. find_{first,last}_of should only be used if searching for multiple different characters, which is never the case with the char argument. This also adds the [[nodiscard]] to the remaining find_{first,last}_of methods.
2021-07-02LibJS: Implement the PrepareForOrdinaryCall abstract operationAndreas Kling
This is used by VM::call_internal() and VM::construct() which roughly map to function objects' [[Call]] and [[Construct]] slots in the spec. Reorganizing this code revealed something weird: NativeFunction gets its strictness by checking VM::in_strict_mode(). In other words, it inherits the strict flag from the caller context. This is quite weird, but many test-js tests rely on it, so let's preserve it until we can think of something nicer.
2021-07-02LibM: Add long double defines of Math ConstantsHediadyoin1
2021-07-02LibM: Implement path for negative powersHendiadyoin1
2021-07-02LibJS: Make SuperCall a proper AST node and clean up evaluationAndreas Kling
2021-07-02LibJS: NewExpression doesn't need compute_this_and_callee()Andreas Kling
Now that NewExpression is separated from CallExpression, it doesn't have to use the ad-hoc compute_this_and_callee() logic.
2021-07-02LibJS: Split out NewExpression evaluation from CallExpressionAndreas Kling
This patch adds an override for NewExpression::execute() in the AST interpreter to separate the logic from CallExpression. As a result, both evaluation functions are simplified. Both expressions are still largely non-conforming, but this makes it easier to work on improving that since we can now deal with them separately. :^)
2021-07-02LibJS: Break out ArgumentListEvaluation AO from CallExpressionAndreas Kling
2021-07-02PixelPaint: Reset layer widgets when closing last tabMarcus Nilsson
When closing the last tab the layer list widget and layer properties widget did not reset since they still had a pointer to the image.
2021-07-02PixelPaint: Add layer to image before setting propertiesMarcus Nilsson
Previously when opening an image with layers that had properties like visibility set, PixelPaint would crash when trying to trigger layer_did_modify_properties() without in image. Avoid this by adding the layer to the image before setting the properties.
2021-07-02LibThreading: Add new detach() API to ThreadSpencer Dixon
Sometimes you don't care about `joining()` the result of a thread. The underlying pthread implementation already existed for detaching and now we expose it to the higher level API.
2021-07-02LibJS: Bring %TypedArray%.prototype.set slightly closer to specIdan Horowitz
Specifically, instead of using the internal {get, put}_by_index methods we now use the GetValueFromBuffer and SetValueInBuffer abstract operations, as required by the specification. While i was here i also replaced a couple custom detached array buffer error messages with the existing ErrorType::DetachedArrayBuffer.
2021-07-02Assistant: Add a new FileProvider to assist in searching the filesystemSpencer Dixon
When searching in Assistant, we now dispatch some background jobs to query the whole filesystem. Activating a result will use the Desktop launcher's default way of opening that file or directory.
2021-07-02LibThreading: Add ability to cancel ongoing BackgroundActionsSpencer Dixon
Handlers of the BackgroundAction are responsible for checking if the action has been cancelled and returning early.
2021-07-02Assistant: Remove Result::Kind in favor of native `typeid`Spencer Dixon
I was unaware of the `typeid` construct in C++ which can be used to achieve the same thing I was doing with this extra Kind enum.
2021-07-02LibJS: Allow patterns in parenthesized arrow function parametersAli Mohammad Pur
2021-07-02LibJS: Allow 'yield' and 'await' as function expression namesAli Mohammad Pur
The spec says so, and test262 checks for this too.
2021-07-02LibJS: Allow binding patterns as for in/of targetsAli Mohammad Pur
2021-07-02LibJS: Allow 'yield' as a variable name outside of generator functionsAli Mohammad Pur
2021-07-02LibJS: Make a slash after a curly close mean not-divisionAli Mohammad Pur
There's no grammar rule that allows this.
2021-07-02LibJS: Parse generator functions in class expressions tooAli Mohammad Pur
2021-07-02Assistant: Change to home directory when spawning applicationsSpencer Dixon
When launching Terminal via Taskbar we change to the users home directory. For consistency, let's also `chdir` to `/home/anon` when launching apps via Assistant's AppProvider.
2021-07-02WindowServer: Fix redrawing menu window that already existedTom
This fixes redrawing a menu where the window menu is reused at a different location or with different content.
2021-07-02LibELF: Use StringView literal to avoid string allocationsBrian Gianforcaro
2021-07-02DynamicLoader: Use string view literal to remove a allocation on startupBrian Gianforcaro
The ""sv operator switches a const char* to String conversion into just a StringView literal.
2021-07-02LibWasm: Give traps a reason and display it when neededAli Mohammad Pur
This makes debugging wasm code a bit easier, as we now know what fails instead of just "too bad, something went wrong".
2021-07-02LibJS: Implement the %TypedArray%.set() functionAli Mohammad Pur
2021-07-02LibWeb: Add the WebAssembly.Module constructorAli Mohammad Pur
2021-07-02LibWeb: Add the WebAssembly.Instance constructorAli Mohammad Pur
2021-07-02LibWeb: Use the correct name to refer to WebAssembly.Memory.prototypeAli Mohammad Pur
Otherwise `instanceof` wouldn't return the correct result.
2021-07-02LibWeb: Split the WebAssemblyInstance object logic into multiple filesAli Mohammad Pur
Now that we're adding a constructor to it, let's split it up like the rest of LibWeb does.
2021-07-02LibJS: Throw on failed PutValue into an environment referenceAndreas Kling
This should really be handled at a different layer of the stack, but this allows us to make progress on the Object rewrite without breaking strict mode assignment tests.
2021-07-02LibJS: Make Environment::put_into_environment() return a success boolAndreas Kling
This code is non-conforming and will eventually get cleaned out once we implement proper variable bindings. However, this will aid us in improving other parts of the code right now.
2021-07-02LibJS: Make ResolveBinding() produce strict References in strict modeAndreas Kling
2021-07-01LibWeb: Do not encode "internal_id" in DOM JSONTimothy Flynn
This is now unused.
2021-07-01LibWeb: Maintain a map of child-to-parent nodes in OOPWV DOM InspectorTimothy Flynn
Currently, each time parent_index() is invoked, two depth-first searches are incurred to find the node's parent and grandparent. This becomes particularly expensive, for example, when trying to scroll through a large <ul> list. Instead, upon creation, traverse the DOM JSON and create a map of child nodes to their parent. Then those two lookups become hash map lookups rather than a DFS traversal.
2021-07-01InspectorServer: Use LocalSocket method to get pidTimothy
2021-07-01LibCore: Add peer pid retrieval for LocalSocketTimothy
This will allow programs connected over unix sockets to retrieve the pid of their peers in a nice way.
2021-07-01LibJS: Try to fix Clang build (NewClass::m_class_expression is unused)Andreas Kling
2021-07-01LibJS: NewClass bytecode instructionJohan Dahlin
This adds a the NewClass bytecode instruction, enough of it is implemented for it to show it in the bytecode (js -d).
2021-07-01DynamicLoader: Remove obsolete commentGunnar Beutner