Age | Commit message (Collapse) | Author |
|
This includes:
- Parsing proper LabelledStatements with try_parse_labelled_statement()
- Removing LabelableStatement
- Implementing the LoopEvaluation semantics via loop_evaluation() in
each IterationStatement subclass; and IterationStatement evaluation
via {For,ForIn,ForOf,ForAwaitOf,While,DoWhile}Statement::execute()
- Updating ReturnStatement, BreakStatement and ContinueStatement to
return the appropriate completion types
- Basically reimplementing TryStatement and SwitchStatement according to
the spec, using completions
- Honoring result completion types in AsyncBlockStart and
OrdinaryCallEvaluateBody
- Removing any uses of the VM unwind mechanism - most importantly,
VM::throw_exception() now exclusively sets an exception and no longer
triggers any unwinding mechanism.
However, we already did a good job updating all of LibWeb and userland
applications to not use it, and the few remaining uses elsewhere don't
rely on unwinding AFAICT.
|
|
In the end this is a nicer API than having separate has_{value,target}()
and having to check those first, and then making another Optional from
the unwrapped value:
completion.has_value() ? completion.value() : Optional<Value> {}
// ^^^^^^^^^^^^^^^^^^
// Implicit creation of non-empty Optional<Value>
This way we need to unwrap the optional ourselves, but can easily pass
it to something else as well.
This is in anticipation of the AST using completions :^)
|
|
|
|
...and make sure to validate the module in WebAssembly::compile()
|
|
|
|
|
|
|
|
|
|
|
|
Let's be consistent with the rest of LibJS (and the rest of the file).
|
|
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
|
|
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
|
|
|
|
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To no one's surprise, this patch is pretty big - this is possibly the
most used AO of all of them. Definitely worth it though.
|
|
Since we don't support IDL typedefs or unions yet, the responsibility
of verifying the type of the argument is temporarily moved from the
generated Wrapper to the implementation.
|
|
|
|
|
|
Let's use Base::visit_edges() when calling the base class, to prevent
accidentally skipping over anyone in the inheritance chain.
|
|
|
|
|
|
Almost everything in LibJS includes Cell.h, don't force all code to
include AK/TypeCasts.h + AK/String.h. Instead include them where they
are actually used and required.
|
|
SignedBigInteger::export() generates sign-magnitude, but the native i64
type uses 2's comp, make this work by exporting it as unsigned and
tweaking the sign later.
|
|
A wasm value containing an F64 does not contain a float, etc.
|
|
...and enable it for LibWeb and test-wasm.
Note that `wasm` will not be limited by this.
|
|
This reverts commit 35394dbfaa23b44a293da85b20a63a10f73572c3.
I pushed the wrong button again, hopefully this will be the last of
such incidents.
|
|
* wasm: Don't try to print the function results if it traps
* LibWasm: Inline some very hot functions
These are mostly pretty small functions too, and they were about ~10%
of runtime.
* LibWasm+Everywhere: Make the instruction count limit configurable
...and enable it for LibWeb and test-wasm.
Note that `wasm` will not be limited by this.
* LibWasm: Remove a useless use of ScopeGuard
There are no multiple exit paths in that function, so we can just put
the ending logic right at the end of the function instead.
|
|
This removes all usages of the non-standard put helper method and
replaces all of it's usages with the specification required alternative
or with define_direct_property where appropriate.
|
|
These are usually incorrect, and people sometimes forget to add the
correct values as a result of them being optional, so they should just
be specified explicitly.
|
|
This removes all usages of the non-standard define_property helper
method and replaces all it's usages with the specification required
alternative or with define_direct_property where appropriate.
|
|
|
|
|
|
|
|
Not just "Foo" or "WebAssemblyFoo". This is how it's accessed from the
outside (JS).
Also fix one case of "not an" => "not a".
|
|
|
|
This makes debugging wasm code a bit easier, as we now know what fails
instead of just "too bad, something went wrong".
|
|
|
|
|
|
Otherwise `instanceof` wouldn't return the correct result.
|
|
Now that we're adding a constructor to it, let's split it up like the
rest of LibWeb does.
|
|
|
|
|