Age | Commit message (Collapse) | Author |
|
|
|
|
|
Specifically, explicitly specify the checked type, use the resulting
value instead of doing the same calculation twice, and break down
calculations to discrete operations to ensure no intermediary overflows
are missed.
|
|
This was almost entirely up-to-spec already, just missing exception
checks, and we now leave the lexical environment in the modified state
if an exception occurs during statement evaluation.
|
|
Specifically, this now explicitly takes the length, adds missing
exceptions checks to calls with user-supplied lengths, takes and uses
the prototype argument, and fixes some spec non-conformance in
ArrayConstructor and its native functions around the use of ArrayCreate
|
|
As well as add 2 missing exception checks in the IteratorComplete and
IteratorValue abstract iterator operations.
|
|
This should throw a ReferenceError, since `delete` is not allowed
on super references.
|
|
This patch implements spec-compliant runtime semantics for the following
constructs:
- super.property
- super[property]
The MakeSuperPropertyReference AO is added to support this. :^)
|
|
ResolveBinding now matches the spec, while the non-conforming parts
are moved to GetIdentifierReference.
Implementing this properly requires variable bindings.
|
|
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.
|
|
|
|
Now that NewExpression is separated from CallExpression, it doesn't
have to use the ad-hoc compute_this_and_callee() logic.
|
|
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. :^)
|
|
|
|
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.
|
|
|
|
The spec says so, and test262 checks for this too.
|
|
|
|
|
|
There's no grammar rule that allows this.
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
This adds a the NewClass bytecode instruction, enough of it
is implemented for it to show it in the bytecode (js -d).
|
|
This PR does not fix the main issue with our current implementation:
The specification requires that we first check the JSON string for
validity with an ECMA-404 compliant parser, and then evaluate it as if
it was javascript code, of which we do neither at the moment.
|
|
Nobody on the outside needs to access this.
|
|
"Records" in the spec are basically C++ classes, so let's drop this
mouthful of a suffix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Defined by https://tc39.es/ecma262/#sec-ordinaryfunctioncreate step #17
and by https://tc39.es/ecma262/#sec-createbuiltinfunction step #6.
|
|
This is equivalent to 58d6a2d0192b7860ecb2edb4aa5d36b389213a15 but for
the left shift operation.
|
|
|
|
|
|
Specifically, we immediately return an empty string when `this` is an
empty string, instead of wasting time in a loop doing nothing N times.
|
|
Specifically, we now cast to a u32 instead of an i32, as well as use
the validity check required by the specification. The current
constructor is still quite far from the specification, as we directly
set the indexed properties' length instead of going through the Array's
overriden DefineOwnProperty. (and as a result the checks imposed by the
ArraySetLength abstract operation)
|
|
|
|
|
|
This allows us to support parsing and serializing BigIntegers to and
from any base N (such that 2 <= N <= 36).
|
|
This is not exactly compliant with the specification, but our current
bound function implementation isn't either, so its not currently
possible to implement it the way the specification requires.
|
|
As well as bring it generally closer to the specification.
|
|
Copy/paste error from toBeTrue().
|
|
|
|
This patch adds a new ArgumentsObject class to represent what the spec
calls "Arguments Exotic Objects"
These are constructed by the new CreateMappedArgumentsObject when the
`arguments` identifier is resolved in a callee context.
The implementation is incomplete and doesn't yet support mapping of
the parameter variables to the indexed properties of `arguments`.
|