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
commit cd1d369cdd
Notes: sideshowbarker 2024-07-19 08:00:21 +09:00
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());
}
}