From 1706231d789e45dbbe1c492974bd14888ef1c123 Mon Sep 17 00:00:00 2001 From: "feng@chromium.org" Date: Tue, 28 Oct 2008 03:39:17 +0000 Subject: [PATCH] Fast check undefined in EQUALS. Review URL: http://codereview.chromium.org/7979 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/runtime.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime.js b/src/runtime.js index 1355356a0..5e73d4100 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -78,12 +78,15 @@ function EQUALS(y) { // NOTE: This checks for both null and undefined. return (y == null) ? 0 : 1; } 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)) { return %_ObjectEquals(x, y) ? 0 : 1; } + x = %ToPrimitive(x, NO_HINT); } } -- 2.34.1