mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +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:
parent
1549c5c48b
commit
cd1d369cdd
Notes:
sideshowbarker
2024-07-19 08:00:21 +09:00
Author: https://github.com/awesomekling
Commit: cd1d369cdd
9 changed files with 49 additions and 34 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue