1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

LibJS: Pass call/construct argument lists as ReadonlySpan<Value>

(Instead of MarkedVector<Value>.) This is a step towards not storing
argument lists in MarkedVector<Value> at all. Note that they still end
up in MarkedVectors since that's what ExecutionContext has.
This commit is contained in:
Andreas Kling 2023-11-27 12:56:20 +01:00
parent 9fa6628efa
commit ece961f882
29 changed files with 119 additions and 112 deletions

View file

@ -61,7 +61,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::apply)
// 3. Perform PrepareForTailCall().
// 4. Return ? Call(target, thisArgument, args).
return TRY(call(vm, target.as_function(), this_argument, move(args)));
return TRY(call(vm, target.as_function(), this_argument, args.span()));
}
// 28.1.2 Reflect.construct ( target, argumentsList [ , newTarget ] ), https://tc39.es/ecma262/#sec-reflect.construct
@ -86,7 +86,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::construct)
auto args = TRY(create_list_from_array_like(vm, arguments_list));
// 5. Return ? Construct(target, args, newTarget).
return TRY(JS::construct(vm, target.as_function(), move(args), &new_target.as_function()));
return TRY(JS::construct(vm, target.as_function(), args.span(), &new_target.as_function()));
}
// 28.1.3 Reflect.defineProperty ( target, propertyKey, attributes ), https://tc39.es/ecma262/#sec-reflect.defineproperty