Allow the ZWJ and ZWNJ characters in IdentifierPart as per ES5.
authorlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 23 Feb 2012 08:15:45 +0000 (08:15 +0000)
committerlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 23 Feb 2012 08:15:45 +0000 (08:15 +0000)
Patch from Mathias Bynens <mathias@qiwi.be>
BUG=1958
TEST=Try `var a\u200c\u200d;` and confirm it doesn't throw an error.

Review URL: https://chromiumcodereview.appspot.com/9433031
Patch from Mathias Bynens <mathias@qiwi.be>.

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

AUTHORS
src/char-predicates.h

diff --git a/AUTHORS b/AUTHORS
index 0f7fa84b30f1c0d62e78bfa156528acb207bf7a1..869be2b74ba0ed15386f283bc930a7403138045b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -31,6 +31,7 @@ John Jozwiak <jjozwiak@codeaurora.org>
 Jonathan Liu <net147@gmail.com>
 Kun Zhang <zhangk@codeaurora.org>
 Martyn Capewell <martyn.capewell@arm.com>
+Mathias Bynens <mathias@qiwi.be>
 Matt Hanselman <mjhanselman@gmail.com>
 Maxim Mossienko <maxim.mossienko@gmail.com>
 Michael Lutz <michi@icosahedron.de>
index 5a901a26aa5553cb71d03de063ac4efa2697c7d2..b97191f5ccb719a2591c144238dc4f8f77849a01 100644 (file)
@@ -57,6 +57,8 @@ struct IdentifierPart {
   static inline bool Is(uc32 c) {
     return IdentifierStart::Is(c)
         || unibrow::Number::Is(c)
+        || c == 0x200C  // U+200C is Zero-Width Non-Joiner.
+        || c == 0x200D  // U+200D is Zero-Width Joiner.
         || unibrow::CombiningMark::Is(c)
         || unibrow::ConnectorPunctuation::Is(c);
   }