mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
LibJS: Remove [[VarNames]] from GlobalEnvironment
This is a normative change in the ECMA-262 spec. See:
ed75310
This commit is contained in:
parent
9c85a16aeb
commit
15faaeb2bb
Notes:
github-actions[bot]
2025-04-29 11:34:32 +00:00
Author: https://github.com/trflynn89
Commit: 15faaeb2bb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4514
5 changed files with 35 additions and 51 deletions
|
@ -32,6 +32,20 @@ TESTJS_GLOBAL_FUNCTION(can_parse_source, canParseSource)
|
|||
return JS::Value(!parser.has_errors());
|
||||
}
|
||||
|
||||
// Based on $262.evalScript
|
||||
TESTJS_GLOBAL_FUNCTION(evaluate_source, evaluateSource)
|
||||
{
|
||||
auto& realm = *vm.current_realm();
|
||||
|
||||
auto source = TRY(vm.argument(0).to_string(vm));
|
||||
|
||||
auto script = JS::Script::parse(source, realm);
|
||||
if (script.is_error())
|
||||
return vm.throw_completion<JS::SyntaxError>(script.error().first().to_string());
|
||||
|
||||
return vm.bytecode_interpreter().run(script.value());
|
||||
}
|
||||
|
||||
TESTJS_GLOBAL_FUNCTION(run_queued_promise_jobs, runQueuedPromiseJobs)
|
||||
{
|
||||
vm.run_queued_promise_jobs();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue