mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
LibJS: Implement the PrepareForOrdinaryCall abstract operation
This is used by VM::call_internal() and VM::construct() which roughly map to function objects' [[Call]] and [[Construct]] slots in the spec. Reorganizing this code revealed something weird: NativeFunction gets its strictness by checking VM::in_strict_mode(). In other words, it inherits the strict flag from the caller context. This is quite weird, but many test-js tests rely on it, so let's preserve it until we can think of something nicer.
This commit is contained in:
parent
8ed3315dec
commit
5ce9305c5f
2 changed files with 80 additions and 32 deletions
|
@ -260,6 +260,7 @@ private:
|
|||
VM();
|
||||
|
||||
[[nodiscard]] Value call_internal(FunctionObject&, Value this_value, Optional<MarkedValueList> arguments);
|
||||
void prepare_for_ordinary_call(FunctionObject&, ExecutionContext& callee_context, Value new_target);
|
||||
|
||||
Exception* m_exception { nullptr };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue