mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
LibJS: Convert has_restricted_global_property() to ThrowCompletionOr
This commit is contained in:
parent
9571631b58
commit
1817c1f83c
3 changed files with 6 additions and 5 deletions
|
@ -3593,9 +3593,10 @@ ThrowCompletionOr<void> Program::global_declaration_instantiation(Interpreter& i
|
|||
return IterationDecision::Break;
|
||||
}
|
||||
|
||||
auto restricted_global = global_environment.has_restricted_global_property(name);
|
||||
if (interpreter.exception())
|
||||
auto restricted_global_or_error = global_environment.has_restricted_global_property(name);
|
||||
if (restricted_global_or_error.is_error())
|
||||
return IterationDecision::Break;
|
||||
auto restricted_global = restricted_global_or_error.release_value();
|
||||
|
||||
if (restricted_global)
|
||||
interpreter.vm().throw_exception<SyntaxError>(global_object, ErrorType::RestrictedGlobalProperty, name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue