mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
LibJS: Convert RegExpObject::create() to NonnullGCPtr
This commit is contained in:
parent
bfb8d83535
commit
cad40ec953
3 changed files with 7 additions and 7 deletions
|
@ -3541,7 +3541,7 @@ Completion RegExpLiteral::execute(Interpreter& interpreter) const
|
|||
// 3. Return ! RegExpCreate(pattern, flags).
|
||||
Regex<ECMA262> regex(parsed_regex(), parsed_pattern(), parsed_flags());
|
||||
// NOTE: We bypass RegExpCreate and subsequently RegExpAlloc as an optimization to use the already parsed values.
|
||||
auto* regexp_object = RegExpObject::create(realm, move(regex), move(pattern), move(flags));
|
||||
auto regexp_object = RegExpObject::create(realm, move(regex), move(pattern), move(flags));
|
||||
// RegExpAlloc has these two steps from the 'Legacy RegExp features' proposal.
|
||||
regexp_object->set_realm(*vm.current_realm());
|
||||
// We don't need to check 'If SameValue(newTarget, thisRealm.[[Intrinsics]].[[%RegExp%]]) is true'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue