diff options
Diffstat (limited to 'deps/v8/src/runtime.js')
-rw-r--r-- | deps/v8/src/runtime.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/deps/v8/src/runtime.js b/deps/v8/src/runtime.js index a12f6c7b09..14ff1b69cf 100644 --- a/deps/v8/src/runtime.js +++ b/deps/v8/src/runtime.js @@ -355,7 +355,7 @@ function IN(x) { if (!IS_SPEC_OBJECT(x)) { throw %MakeTypeError('invalid_in_operator_use', [this, x]); } - return %_IsNonNegativeSmi(this) ? + return %_IsNonNegativeSmi(this) && !%IsJSProxy(x) ? %HasElement(x, this) : %HasProperty(x, %ToString(this)); } @@ -429,10 +429,20 @@ function CALL_FUNCTION_PROXY() { } -function CALL_FUNCTION_PROXY_AS_CONSTRUCTOR() { - var proxy = this; +function CALL_FUNCTION_PROXY_AS_CONSTRUCTOR(proxy) { + var arity = %_ArgumentsLength() - 1; var trap = %GetConstructTrap(proxy); - return %Apply(trap, this, arguments, 0, %_ArgumentsLength()); + var receiver = void 0; + if (!IS_UNDEFINED(trap)) { + trap = %GetCallTrap(proxy); + var proto = proxy.prototype; + if (!IS_SPEC_OBJECT(proto) && proto !== null) { + throw MakeTypeError("proto_object_or_null", [proto]); + } + receiver = new global.Object(); + receiver.__proto__ = proto; + } + return %Apply(trap, this, arguments, 1, arity); } |