diff options
| author | Kristian Monsen <kristianm@google.com> | 2010-05-21 11:50:48 +0100 |
|---|---|---|
| committer | Kristian Monsen <kristianm@google.com> | 2010-05-21 12:01:46 +0100 |
| commit | 25f6136652d8341ed047e7fc1a450af5bd218ea9 (patch) | |
| tree | 1aaefdeb728884cf07eccd51130ba7438611ce6d /src/runtime.js | |
| parent | 388eba4e819805cb37ffe18231f53c79102356ae (diff) | |
| download | android_external_v8-25f6136652d8341ed047e7fc1a450af5bd218ea9.tar.gz android_external_v8-25f6136652d8341ed047e7fc1a450af5bd218ea9.tar.bz2 android_external_v8-25f6136652d8341ed047e7fc1a450af5bd218ea9.zip | |
Merge WebKit at r59636: Update v8 to r4660.
Will build and run with current webkit.
Change-Id: I57bae621fd894da363ba84e1757ad09eb7c502b9
Diffstat (limited to 'src/runtime.js')
| -rw-r--r-- | src/runtime.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/runtime.js b/src/runtime.js index be93c4fe..8e3883f7 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -80,10 +80,7 @@ function EQUALS(y) { } else { // x is not a number, boolean, null or undefined. if (y == null) return 1; // not equal - if (IS_OBJECT(y)) { - return %_ObjectEquals(x, y) ? 0 : 1; - } - if (IS_FUNCTION(y)) { + if (IS_SPEC_OBJECT_OR_NULL(y)) { return %_ObjectEquals(x, y) ? 0 : 1; } @@ -344,7 +341,7 @@ function DELETE(key) { // ECMA-262, section 11.8.7, page 54. function IN(x) { - if (x == null || (!IS_OBJECT(x) && !IS_FUNCTION(x))) { + if (x == null || !IS_SPEC_OBJECT_OR_NULL(x)) { throw %MakeTypeError('invalid_in_operator_use', [this, x]); } return %_IsNonNegativeSmi(this) ? %HasElement(x, this) : %HasProperty(x, %ToString(this)); @@ -362,13 +359,13 @@ function INSTANCE_OF(F) { } // If V is not an object, return false. - if (IS_NULL(V) || (!IS_OBJECT(V) && !IS_FUNCTION(V))) { + if (IS_NULL(V) || !IS_SPEC_OBJECT_OR_NULL(V)) { return 1; } // Get the prototype of F; if it is not an object, throw an error. var O = F.prototype; - if (IS_NULL(O) || (!IS_OBJECT(O) && !IS_FUNCTION(O))) { + if (IS_NULL(O) || !IS_SPEC_OBJECT_OR_NULL(O)) { throw %MakeTypeError('instanceof_nonobject_proto', [O]); } @@ -482,7 +479,7 @@ function ToPrimitive(x, hint) { // Fast case check. if (IS_STRING(x)) return x; // Normal behavior. - if (!IS_OBJECT(x) && !IS_FUNCTION(x)) return x; + if (!IS_SPEC_OBJECT_OR_NULL(x)) return x; if (x == null) return x; // check for null, undefined if (hint == NO_HINT) hint = (IS_DATE(x)) ? STRING_HINT : NUMBER_HINT; return (hint == NUMBER_HINT) ? %DefaultNumber(x) : %DefaultString(x); @@ -587,7 +584,7 @@ function SameValue(x, y) { // Returns if the given x is a primitive value - not an object or a // function. function IsPrimitive(x) { - if (!IS_OBJECT(x) && !IS_FUNCTION(x)) { + if (!IS_SPEC_OBJECT_OR_NULL(x)) { return true; } else { // Even though the type of null is "object", null is still |
