Change IS_UNDEFINED to perform value comparison instead on typeof check.
authordslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 17 Apr 2014 13:55:03 +0000 (13:55 +0000)
committerdslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 17 Apr 2014 13:55:03 +0000 (13:55 +0000)
This makes our builtins immune to bug v8:3264.

R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/241003002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20850 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/macros.py

index f12c6c8..0035451 100644 (file)
@@ -101,7 +101,7 @@ const STRING_TO_REGEXP_CACHE_ID = 0;
 #       values of 'bar'.
 macro IS_NULL(arg)              = (arg === null);
 macro IS_NULL_OR_UNDEFINED(arg) = (arg == null);
-macro IS_UNDEFINED(arg)         = (typeof(arg) === 'undefined');
+macro IS_UNDEFINED(arg)         = (arg === (void 0));
 macro IS_NUMBER(arg)            = (typeof(arg) === 'number');
 macro IS_STRING(arg)            = (typeof(arg) === 'string');
 macro IS_BOOLEAN(arg)           = (typeof(arg) === 'boolean');