Linus Groh
87a89e7126
LibJS: Convert create_global_function_binding() to ThrowCompletionOr
2021-12-29 16:02:44 +01:00
Linus Groh
4767be1459
LibJS: Convert create_global_var_binding() to ThrowCompletionOr
2021-12-29 16:00:36 +01:00
Linus Groh
8296d3fbd2
LibJS: Convert can_declare_global_function() to ThrowCompletionOr
2021-12-29 15:56:53 +01:00
Linus Groh
215a56b0e4
LibJS: Convert can_declare_global_var() to ThrowCompletionOr
2021-12-29 15:54:44 +01:00
Linus Groh
1817c1f83c
LibJS: Convert has_restricted_global_property() to ThrowCompletionOr
2021-12-29 15:50:50 +01:00
Linus Groh
7204b292c5
LibJS: Implement and use the MakeMethod AO
...
Two direct uses of the set_home_object() setter remain, we should fix
those up and remove it eventually.
2021-12-29 10:34:34 +01:00
Linus Groh
df931e6a83
LibJS: Implement and use the InitializeBoundName AO
2021-12-29 10:34:28 +01:00
Linus Groh
451149df0b
LibJS: Ensure get_new_target() never returns an empty value
...
Also add spec comments and remove a redundant exception check while
we're here :^)
2021-12-29 00:16:51 +01:00
Linus Groh
8d70a50aed
LibJS: Remove unused MemberExpression::computed_property_name()
2021-12-29 00:16:51 +01:00
davidot
be3b806487
LibJS: Parse assert clauses of in- and export statements
...
Based on proposal: https://tc39.es/proposal-import-assertions
Since imports are not supported yet this is not functional.
2021-12-21 14:04:23 +01:00
Linus Groh
038d354b5d
LibJS: Remove Object::value_of()
...
Being really close to Object.prototype.valueOf() name wise makes this
unnecessarily confusing - while it sometimes serves as the
implementation of a valueOf() function, it's an abstraction which the
spec doesn't have.
Use the appropriate getters to retrieve specific internal slots instead,
most commonly [[FooData]] from the primitive wrapper objects.
For the Object class specifically, use the Value(Object*) ctor instead.
2021-12-10 22:52:36 +00:00
davidot
045a42cf35
LibJS: Parse dynamic import calls 'import()' and 'import.meta'
...
For now both just throw when executing but this can be implemented when
modules are implemented :^).
2021-11-30 17:05:32 +00:00
davidot
e69276e704
LibJS: Implement parsing and executing for-await-of loops
2021-11-29 15:20:07 +00:00
davidot
0982a73d1d
LibJS: Parse async generator functions
2021-11-21 21:46:39 +00:00
Idan Horowitz
46dabf02ec
LibJS: Add support for await expressions
2021-11-10 08:48:27 +00:00
Idan Horowitz
681787de76
LibJS: Add support for async functions
...
This commit adds support for the most bare bones version of async
functions, support for async generator functions, async arrow functions
and await expressions are TODO.
2021-11-10 08:48:27 +00:00
Idan Horowitz
853fab352d
LibJS: Convert the InitializeReferencedBinding AO to ThrowCompletionOr
2021-11-02 19:48:35 +01:00
Idan Horowitz
1aaaf521b8
LibJS: Convert the PutValue AO to ThrowCompletionOr
2021-11-02 19:48:35 +01:00
Idan Horowitz
390a04a985
LibJS: Convert the GetValue AO to ThrowCompletionOr
2021-11-02 19:48:35 +01:00
Idan Horowitz
d73b258874
LibJS: Convert reference deletion to ThrowCompletionOr
2021-11-02 19:48:35 +01:00
Andreas Kling
c02e992de2
LibJS: Use PropertyKey in MemberExpression::to_reference()
2021-10-24 17:18:09 +02:00
Andreas Kling
398c181c79
LibJS: Rename PropertyName to PropertyKey
...
Let's use the same name as the spec. :^)
2021-10-24 17:18:07 +02:00
davidot
9c9aaf4d4f
LibJS: Don't VERIFY that a function is Regular when executing in AST
...
By replacing this VERIFY with a thrown Error we no longer crash when
calling a generator function in the AST interpreter. This allows us to
more gracefully handle situation which have not been implemented yet.
In particular this helps the libjs-test262-runner since it can now
continue on to the next tests instead of having the entire process end.
2021-10-24 08:38:02 +01:00
Idan Horowitz
e26d9f419b
LibJS: Remove vm.construct and it's usages
2021-10-23 02:49:41 +03:00
Idan Horowitz
db5df26841
LibJS: Convert Array AOs to ThrowCompletionOr
2021-10-22 15:07:04 +03:00
Timothy Flynn
04b4307b3d
LibJS: Convert get_iterator_values helper to ThrowCompletionOr
...
This one is a bit unusual, so to clarify:
Previously, callers of get_iterator_values() would supply a callback
that would return an IterationDecision, and an enum to indicate whether
iterator_close() should be invoked upon IterationDecision::Break.
Now, use of both those enums is removed, and callers must return an
Optional<Completion>. If a Completion is provided, the iterator will be
closed, and that completion will be returned from get_iterator_values.
Otherwise, once the iterator is exhausted, a default-initialized
Completion will be returned.
2021-10-21 00:26:45 +01:00
davidot
2d48529073
LibJS: Implement private identifiers in optional chains
2021-10-20 23:19:17 +01:00
davidot
4c8090a45d
LibJS: Use ClassFieldInitializerStatement for class fields
...
This is necessary as we might have to perform named evaluation with the
field name.
Ideally we would also skip some setup parts of the function like
function_declaration_instantiation however this would require bigger
changes to ECMAScriptFunctionObject.
2021-10-20 23:19:17 +01:00
davidot
7e8724db71
LibJS: Add support for the '#privateName in obj' expression
2021-10-20 23:19:17 +01:00
davidot
16cc82460f
LibJS: Add parsing and evaluation of private fields and methods
2021-10-20 23:19:17 +01:00
davidot
13ead80ee6
LibJS: Add PrivateEnvironment
2021-10-20 23:19:17 +01:00
davidot
6b2accce31
LibJS: Add static initializers to classes
2021-10-20 23:19:17 +01:00
davidot
1245512c50
LibJS: Make class definition evaluation more spec like in ordering
2021-10-20 23:19:17 +01:00
Idan Horowitz
545d403f6b
LibJS: Convert Value operator AOs to ThrowCompletionOr
2021-10-18 23:06:11 +01:00
Idan Horowitz
48ac15758e
LibJS: Convert is_loosely_equal() to ThrowCompletionOr
2021-10-18 23:06:11 +01:00
Idan Horowitz
c488f5a59d
LibJS: Convert to_property_key() to ThrowCompletionOr
2021-10-17 12:12:35 +01:00
Idan Horowitz
b8f101888b
LibJS: Convert to_numeric() to ThrowCompletionOr
2021-10-17 12:12:35 +01:00
davidot
c3cb44ca8a
LibJS: Remove ErrorType::FixmeAddAnErrorStringWithMessage
2021-10-15 10:27:16 +01:00
davidot
1fe6a422f1
LibJS: Fix null deref in ObjectProperty::dump()
2021-10-15 10:27:16 +01:00
Linus Groh
c70784bb82
LibJS: Implement ShadowRealm.prototype.evaluate()
2021-10-14 00:41:41 +01:00
Linus Groh
52976bfac6
LibJS: Convert to_object() to ThrowCompletionOr
2021-10-13 09:55:10 +01:00
Linus Groh
4d8912a92b
LibJS: Convert to_string() to ThrowCompletionOr
...
Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
2021-10-13 09:55:10 +01:00
Linus Groh
f35e268024
LibJS: Convert get_binding_value() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00
Linus Groh
7652138ce0
LibJS: Convert set_mutable_binding() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00
Linus Groh
ae397541fb
LibJS: Convert initialize_binding() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00
Linus Groh
2691c65639
LibJS: Convert create_immutable_binding() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00
Linus Groh
4baf3a91e8
LibJS: Convert create_mutable_binding() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00
Linus Groh
fbb176c926
LibJS: Convert has_binding() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00
Linus Groh
617d3cd3d3
LibJS: Convert bind_this_value() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00
Linus Groh
0aa24f4ce5
LibJS: Convert get_this_binding() to ThrowCompletionOr
...
Also add spec step comments to it while we're here.
2021-10-09 21:53:47 +01:00