diff options
| author | Ben Murdoch <benm@google.com> | 2012-03-05 11:04:45 +0000 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2012-04-11 15:39:56 +0100 |
| commit | 592a9fc1d8ea420377a2e7efd0600e20b058be2b (patch) | |
| tree | 23fe22995f4f9056a96266d169d49426a5e745d7 /src/runtime.js | |
| parent | e25ed7434cc3a061dd965ad25b923bca153aed94 (diff) | |
| download | android_external_v8-592a9fc1d8ea420377a2e7efd0600e20b058be2b.tar.gz android_external_v8-592a9fc1d8ea420377a2e7efd0600e20b058be2b.tar.bz2 android_external_v8-592a9fc1d8ea420377a2e7efd0600e20b058be2b.zip | |
Merge V8 at 3.7.12.28
Bug: 5688872
Change-Id: Iddb40cae44d51a2b449f2858951e0472771f5981
Diffstat (limited to 'src/runtime.js')
| -rw-r--r-- | src/runtime.js | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/runtime.js b/src/runtime.js index 14ff1b69..d0cdb3ef 100644 --- a/src/runtime.js +++ b/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) && !%IsJSProxy(x) ? + return %_IsNonNegativeSmi(this) ? %HasElement(x, this) : %HasProperty(x, %ToString(this)); } @@ -375,6 +375,12 @@ function INSTANCE_OF(F) { return 1; } + // Check if function is bound, if so, get [[BoundFunction]] from it + // and use that instead of F. + var bindings = %BoundFunctionGetBindings(F); + if (bindings) { + F = bindings[kBoundFunctionIndex]; // Always a non-bound function. + } // Get the prototype of F; if it is not an object, throw an error. var O = F.prototype; if (!IS_SPEC_OBJECT(O)) { @@ -386,13 +392,6 @@ function INSTANCE_OF(F) { } -// Get an array of property keys for the given object. Used in -// for-in statements. -function GET_KEYS() { - return %GetPropertyNames(this); -} - - // Filter a given key against an object by checking if the object // has a property with the given key; return the key as a string if // it has. Otherwise returns 0 (smi). Used in for-in statements. @@ -429,20 +428,10 @@ function CALL_FUNCTION_PROXY() { } -function CALL_FUNCTION_PROXY_AS_CONSTRUCTOR(proxy) { - var arity = %_ArgumentsLength() - 1; +function CALL_FUNCTION_PROXY_AS_CONSTRUCTOR() { + var proxy = this; var trap = %GetConstructTrap(proxy); - 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); + return %Apply(trap, this, arguments, 0, %_ArgumentsLength()); } @@ -469,11 +458,12 @@ function APPLY_PREPARE(args) { } if (!IS_SPEC_FUNCTION(this)) { - throw %MakeTypeError('apply_non_function', [ %ToString(this), typeof this ]); + throw %MakeTypeError('apply_non_function', + [ %ToString(this), typeof this ]); } // Make sure the arguments list has the right type. - if (args != null && !IS_ARRAY(args) && !IS_ARGUMENTS(args)) { + if (args != null && !IS_SPEC_OBJECT(args)) { throw %MakeTypeError('apply_wrong_args', []); } |
