diff options
| author | Ben Murdoch <benm@google.com> | 2010-07-22 14:51:16 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2010-07-22 14:51:16 +0100 |
| commit | 3bec4d28b1f388dbc06a9c4276e1a03e86c52b04 (patch) | |
| tree | 538bb9cb5e3664733f56ba3292342ccc426eb9f9 /src/runtime.js | |
| parent | 2794f167cd167a39859e9be5be3b05bdb5feb10a (diff) | |
| download | android_external_v8-3bec4d28b1f388dbc06a9c4276e1a03e86c52b04.tar.gz android_external_v8-3bec4d28b1f388dbc06a9c4276e1a03e86c52b04.tar.bz2 android_external_v8-3bec4d28b1f388dbc06a9c4276e1a03e86c52b04.zip | |
Update V8 to r5091 as required by WebKit r63859.
Change-Id: I8e35d765e6f6c7f89eccff900e1cabe2d5dd6110
Diffstat (limited to 'src/runtime.js')
| -rw-r--r-- | src/runtime.js | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/runtime.js b/src/runtime.js index ab6e3e9d..aca19457 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -80,7 +80,7 @@ function EQUALS(y) { } else { // x is not a number, boolean, null or undefined. if (y == null) return 1; // not equal - if (IS_SPEC_OBJECT_OR_NULL(y)) { + if (IS_SPEC_OBJECT(y)) { return %_ObjectEquals(x, y) ? 0 : 1; } @@ -345,7 +345,7 @@ function DELETE(key) { // ECMA-262, section 11.8.7, page 54. function IN(x) { - if (x == null || !IS_SPEC_OBJECT_OR_NULL(x)) { + if (!IS_SPEC_OBJECT(x)) { throw %MakeTypeError('invalid_in_operator_use', [this, x]); } return %_IsNonNegativeSmi(this) ? %HasElement(x, this) : %HasProperty(x, %ToString(this)); @@ -363,13 +363,13 @@ function INSTANCE_OF(F) { } // If V is not an object, return false. - if (IS_NULL(V) || !IS_SPEC_OBJECT_OR_NULL(V)) { + if (!IS_SPEC_OBJECT(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_SPEC_OBJECT_OR_NULL(O)) { + if (!IS_SPEC_OBJECT(O)) { throw %MakeTypeError('instanceof_nonobject_proto', [O]); } @@ -431,7 +431,7 @@ function APPLY_PREPARE(args) { // big enough, but sanity check the value to avoid overflow when // multiplying with pointer size. if (length > 0x800000) { - throw %MakeRangeError('apply_overflow', [length]); + throw %MakeRangeError('stack_overflow', []); } if (!IS_FUNCTION(this)) { @@ -450,7 +450,7 @@ function APPLY_PREPARE(args) { function APPLY_OVERFLOW(length) { - throw %MakeRangeError('apply_overflow', [length]); + throw %MakeRangeError('stack_overflow', []); } @@ -483,8 +483,7 @@ function ToPrimitive(x, hint) { // Fast case check. if (IS_STRING(x)) return x; // Normal behavior. - if (!IS_SPEC_OBJECT_OR_NULL(x)) return x; - if (x == null) return x; // check for null, undefined + if (!IS_SPEC_OBJECT(x)) return x; if (hint == NO_HINT) hint = (IS_DATE(x)) ? STRING_HINT : NUMBER_HINT; return (hint == NUMBER_HINT) ? %DefaultNumber(x) : %DefaultString(x); } @@ -583,13 +582,10 @@ function SameValue(x, y) { // Returns if the given x is a primitive value - not an object or a // function. function IsPrimitive(x) { - if (!IS_SPEC_OBJECT_OR_NULL(x)) { - return true; - } else { - // Even though the type of null is "object", null is still - // considered a primitive value. - return IS_NULL(x); - } + // Even though the type of null is "object", null is still + // considered a primitive value. IS_SPEC_OBJECT handles this correctly + // (i.e., it will return false if x is null). + return !IS_SPEC_OBJECT(x); } |
