Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: src/char-predicates.h

Issue 626073002: Update identifier syntax to disallow U+2E2F (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/var.js » ('j') | test/mjsunit/var.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/char-predicates.h
diff --git a/src/char-predicates.h b/src/char-predicates.h
index b7c5d42320fc953c1744016f39a846e4eb1bb978..c7435a2b3507d6ec4a3000e63257668ebd3b2b6d 100644
--- a/src/char-predicates.h
+++ b/src/char-predicates.h
@@ -26,6 +26,8 @@ struct IdentifierStart {
static inline bool Is(uc32 c) {
switch (c) {
case '$': case '_': case '\\': return true;
+ case 0x2e2f:
+ return false; // U+2E2F is Vertical tilde.
default: return unibrow::Letter::Is(c);
}
}
@@ -34,6 +36,7 @@ struct IdentifierStart {
struct IdentifierPart {
static inline bool Is(uc32 c) {
+ if (c == 0x2e2f) return false; // U+2E2F is Vertical tilde.
return IdentifierStart::Is(c)
|| unibrow::Number::Is(c)
|| c == 0x200C // U+200C is Zero-Width Non-Joiner.
« no previous file with comments | « no previous file | test/mjsunit/var.js » ('j') | test/mjsunit/var.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698