From 5468fbb19e31ef8d00b3229127688400050b0d30 Mon Sep 17 00:00:00 2001 From: "lrn@chromium.org" Date: Thu, 23 Feb 2012 08:15:45 +0000 Subject: [PATCH] Allow the ZWJ and ZWNJ characters in IdentifierPart as per ES5. Patch from Mathias Bynens 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 . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10800 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- AUTHORS | 1 + src/char-predicates.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 0f7fa84b30..869be2b74b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -31,6 +31,7 @@ John Jozwiak Jonathan Liu Kun Zhang Martyn Capewell +Mathias Bynens Matt Hanselman Maxim Mossienko Michael Lutz diff --git a/src/char-predicates.h b/src/char-predicates.h index 5a901a26aa..b97191f5cc 100644 --- a/src/char-predicates.h +++ b/src/char-predicates.h @@ -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); }