mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Add NewTarget parameter to builtin functions
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
0d45add63e
commit
e32b181f4f
42 changed files with 482 additions and 479 deletions
|
|
@ -149,7 +149,7 @@ Value NativeFunctionObject::processNativeFunctionCall(ExecutionState& state, con
|
|||
}
|
||||
|
||||
if (isConstruct) {
|
||||
Value result = code->m_fn(newState, receiver, argc, argv, isConstruct);
|
||||
Value result = code->m_fn(newState, receiver, argc, argv, newTarget);
|
||||
if (UNLIKELY(!result.isObject())) {
|
||||
ErrorObject::throwBuiltinError(newState, ErrorObject::TypeError, "Native Constructor must returns constructed new object");
|
||||
}
|
||||
|
|
@ -172,7 +172,8 @@ Value NativeFunctionObject::processNativeFunctionCall(ExecutionState& state, con
|
|||
}
|
||||
return result;
|
||||
} else {
|
||||
return code->m_fn(newState, receiver, argc, argv, isConstruct);
|
||||
ASSERT(!newTarget);
|
||||
return code->m_fn(newState, receiver, argc, argv, Value());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue