Index: src/runtime.js |
=================================================================== |
--- src/runtime.js (revision 9808) |
+++ src/runtime.js (working copy) |
@@ -375,6 +375,12 @@ |
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 @@ |
} |
-// 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. |
@@ -463,7 +462,7 @@ |
} |
// 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', []); |
} |