diff options
| author | Steve Block <steveblock@google.com> | 2010-07-08 12:39:36 +0100 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-07-08 12:41:04 +0100 |
| commit | 8defd9ff6930b4e24729971a61cf7469daf119be (patch) | |
| tree | 3be589af44201dcaead530f4046cb63e7c9b68c4 /src/runtime.js | |
| parent | 85dec77e821ae98054f8e09ba3180c148a9264d6 (diff) | |
| download | android_external_v8-8defd9ff6930b4e24729971a61cf7469daf119be.tar.gz android_external_v8-8defd9ff6930b4e24729971a61cf7469daf119be.tar.bz2 android_external_v8-8defd9ff6930b4e24729971a61cf7469daf119be.zip | |
Update V8 to r5017 as required by WebKit r62496
Change-Id: I1b4b7718d1d77ceef07f543e9150a2cb3a628f3a
Diffstat (limited to 'src/runtime.js')
| -rw-r--r-- | src/runtime.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/runtime.js b/src/runtime.js index 3e4d473c..ab6e3e9d 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -112,7 +112,7 @@ function STRICT_EQUALS(x) { // the result when either (or both) the operands are NaN. function COMPARE(x, ncr) { var left; - + var right; // Fast cases for string, numbers and undefined compares. if (IS_STRING(this)) { if (IS_STRING(x)) return %_StringCompare(this, x); @@ -123,14 +123,18 @@ function COMPARE(x, ncr) { if (IS_UNDEFINED(x)) return ncr; left = this; } else if (IS_UNDEFINED(this)) { + if (!IS_UNDEFINED(x)) { + %ToPrimitive(x, NUMBER_HINT); + } + return ncr; + } else if (IS_UNDEFINED(x)) { + %ToPrimitive(this, NUMBER_HINT); return ncr; } else { - if (IS_UNDEFINED(x)) return ncr; left = %ToPrimitive(this, NUMBER_HINT); } - // Default implementation. - var right = %ToPrimitive(x, NUMBER_HINT); + right = %ToPrimitive(x, NUMBER_HINT); if (IS_STRING(left) && IS_STRING(right)) { return %_StringCompare(left, right); } else { |
