mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]
This is where the fun begins. :^)
This commit is contained in:
parent
f6c4a0f5d0
commit
a022e548b8
Notes:
sideshowbarker
2024-07-17 08:00:44 +09:00
Author: https://github.com/linusg
Commit: a022e548b8
Pull-request: https://github.com/SerenityOS/serenity/pull/14973
Reviewed-by: https://github.com/davidot ✅
129 changed files with 1230 additions and 1325 deletions
|
@ -33,12 +33,11 @@ void RegExpConstructor::initialize(Realm& realm)
|
|||
ThrowCompletionOr<Value> RegExpConstructor::call()
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
auto& global_object = this->global_object();
|
||||
|
||||
auto pattern = vm.argument(0);
|
||||
auto flags = vm.argument(1);
|
||||
|
||||
bool pattern_is_regexp = TRY(pattern.is_regexp(global_object));
|
||||
bool pattern_is_regexp = TRY(pattern.is_regexp(vm));
|
||||
|
||||
if (pattern_is_regexp && flags.is_undefined()) {
|
||||
auto pattern_constructor = TRY(pattern.as_object().get(vm.names.constructor));
|
||||
|
@ -58,7 +57,7 @@ ThrowCompletionOr<Object*> RegExpConstructor::construct(FunctionObject&)
|
|||
auto pattern = vm.argument(0);
|
||||
auto flags = vm.argument(1);
|
||||
|
||||
bool pattern_is_regexp = TRY(pattern.is_regexp(global_object));
|
||||
bool pattern_is_regexp = TRY(pattern.is_regexp(vm));
|
||||
|
||||
Value pattern_value;
|
||||
Value flags_value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue