Age | Commit message (Collapse) | Author |
|
This was defined twice, despite being the very same thing:
- ClassElement::ClassFieldDefinition
- ECMAScriptFunctionObject::InstanceField
Move the former to a new header and use it everywhere. Also update the
define_field() AO to take a single field instead of separate name and
initializer arguments.
|
|
This used to put the value in the previous frame's accumulator register,
which is only correct for the first invocation of the generator.
|
|
|
|
Another day, another mistake that's been there for a long time but
would've been immediately obvious when adding spec comments. :^)
|
|
|
|
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/e7979fd
Note that this implements a FIXME in InitializeTypedArrayFromTypedArray,
now that shared array buffers are no longer a concern there. We already
have test coverage for the now-handled case.
|
|
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/a90670d5
This also adds missing spec comments to the following prototypes which
were affected by this change:
Atomics.load
Atomics.store
%TypedArray%.prototype.slice
%TypedArray%.prototype.subarray
|
|
|
|
Not only is it easier to compare to the spec when defined out of line,
but this AO was implemented inside other AOs twice.
|
|
%TypedArray%.prototype.set was a bit hard to read / compare to the spec
with these AOs defined inside it.
|
|
Regressed with 35fcb028e950c804f8f0e5295b369ee1bc541ae3.
|
|
- Use a vector or references for the transition chain since null shapes
are not allowed in the chain.
- Use Vector::in_reverse() for iterating the chain backwards.
|
|
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/4d570c4
|
|
This is an editorial change in the ECMA-262 and Temporal specs.
See:
- https://github.com/tc39/ecma262/commit/843d8b8
- https://github.com/tc39/proposal-temporal/commit/f9211d9
Note that we don't actually need to implement the AO as we already have
String::formatted() for this, and use unified format strings instead of
zero-padding in individual steps in many cases anyway.
|
|
The existing code looks innocently correct, implementing the following
step:
3. If IsCallable(func) is false, set func to the intrinsic function
%Object.prototype.toString%.
as
return ObjectPrototype::to_string(vm, global_object);
However, this misses the fact that the next step calls the function with
the previously ToObject()'d this value (`array`):
4. Return ? Call(func, array).
This doesn't happen in the current implementation, which will use the
unaltered this value from the Array.prototype.toString() call, and make
another, unequal object in %Object.prototype.toString%. Since both that
and Array.prototype.toString() do a Get() call on said object, this
behavior is observable (see newly added test).
Fix this by actually doing what the spec says and calling the fallback
function the regular way.
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/01714a5
|
|
|
|
Having all spec comments verbatim on their own line with no additions
made by us will make it easier to automate comparing said comments to
their current spec counterparts.
|
|
I noticed we were missing this when I added to PerformEval :^)
|
|
|
|
While adding spec comments to PerformEval, I noticed we were missing
multiple steps.
Namely, these were:
- Checking if the host will allow us to compile the string
(allowing LibWeb to perform CSP for eval)
- The parser's initial state depending on the environment around us
on direct eval:
- Allowing new.target via eval in functions
- Allowing super calls and super properties via eval in classes
- Disallowing the use of the arguments object in class field
initializers at eval's parse time
- Setting ScriptOrModule of eval's execution context
The spec allows us to apply the additional parsing steps in any order.
The method I have gone with is passing in a struct to the parser's
constructor, which overrides the parser's initial state to (dis)allow
the things stated above from the get-go.
|
|
|
|
|
|
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/e0c74e1
|
|
The spec notes that this AO is unused by ECMA-262, but is provided for
ECMAScript hosts. Move the definition to a common location to allow
test-js to also use it.
|
|
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/5e161a2
|
|
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/6fa5b9d
|
|
These are editorial changes in the Intl spec. See:
https://github.com/tc39/ecma402/commit/7d0326c
https://github.com/tc39/ecma402/commit/05a299b
https://github.com/tc39/ecma402/commit/8c24ea7
https://github.com/tc39/ecma402/commit/fd8dea9
|
|
This FIXME was addressed in 0975eba7241ff44fcfc5f3be074a09b353ebae5f.
|
|
We had code for this in ScopeNode, but that function was never called
for a SwitchStatement.
This fixes a bunch of scoping tests for switch.
|
|
A function may be redefined, in which case the existing binding is
expected to be reused.
|
|
Previously this would've said `make_handle(Value(1234))` is null, as it
did not contain a cell (but rather a plain Value), which made throwing
primitives spin forever in BC mode.
|
|
|
|
- Remove unused declarations of removed functions
- Remove unused includes
- Declare pointer values as `auto*`
|
|
These were incorrectly used during the conversion from exception checks
to completions.
|
|
|
|
This also uses <time.h> APIs internally, but wraps them in a much nicer
interface.
|
|
This ensures that different NaN types (e.g. 0/0, 0 * Infinity, etc) are
mapped to the same Set/Map entry.
|
|
|
|
Instead of asserting, just return an empty Handle.
|
|
e.g. `for ([foo.bar] in ...)` is actually a binding pattern.
|
|
|
|
|
|
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/39eeecd
|
|
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/61e8dd0
|
|
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/8c73780
|
|
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/4f7519a
|
|
This is a normative change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/08bcd53
- https://github.com/tc39/proposal-temporal/commit/e962797
|
|
This stops clangd from complaining about not being able to determine the
copy-constructibility of ThrowCompletionOr and Completion.
|