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

LibJS: Add argument(i) and argument_count() to Interpreter

Add some convenience accessors for retrieving arguments from the
current call frame.
This commit is contained in:
Andreas Kling 2020-04-01 22:38:59 +02:00
parent 1549c5c48b
commit cd1d369cdd
9 changed files with 49 additions and 34 deletions

View file

@ -39,9 +39,9 @@ Value GlobalObject::gc(Interpreter& interpreter)
Value GlobalObject::is_nan(Interpreter& interpreter)
{
if (interpreter.call_frame().arguments.size() < 1)
if (interpreter.argument_count() < 1)
return js_undefined();
return Value(interpreter.call_frame().arguments[0].to_number().is_nan());
return Value(interpreter.argument(0).to_number().is_nan());
}
}