diff options
Diffstat (limited to 'deps/v8/src/runtime.js')
-rw-r--r-- | deps/v8/src/runtime.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/deps/v8/src/runtime.js b/deps/v8/src/runtime.js index 63e92921a4..c8ccf9f846 100644 --- a/deps/v8/src/runtime.js +++ b/deps/v8/src/runtime.js @@ -327,6 +327,18 @@ function CALL_NON_FUNCTION() { } +function CALL_NON_FUNCTION_AS_CONSTRUCTOR() { + var callee = %GetCalledFunction(); + var delegate = %GetConstructorDelegate(callee); + if (!IS_FUNCTION(delegate)) { + throw %MakeTypeError('called_non_callable', [typeof callee]); + } + + var parameters = %NewArguments(delegate); + return delegate.apply(callee, parameters); +} + + function APPLY_PREPARE(args) { var length; // First check whether length is a positive Smi and args is an array. This is the |