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

Unified Diff: src/token.h

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 5 years, 11 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
Index: src/token.h
diff --git a/src/token.h b/src/token.h
index 9fc330acddb8db1f32331c3265ef0b8a4903a486..2c2ad84e5722f91da525732a11393df20d72f0f8 100644
--- a/src/token.h
+++ b/src/token.h
@@ -193,7 +193,7 @@ class Token {
return token_type[tok] == 'K';
}
- static bool IsIdentifier(Value tok, StrictMode strict_mode,
+ static bool IsIdentifier(Value tok, LanguageMode language_mode,
bool is_generator) {
switch (tok) {
case IDENTIFIER:
@@ -201,9 +201,9 @@ class Token {
case FUTURE_STRICT_RESERVED_WORD:
case LET:
case STATIC:
- return strict_mode == SLOPPY;
+ return !is_strict(language_mode);
case YIELD:
- return !is_generator && strict_mode == SLOPPY;
+ return !is_generator && !is_strict(language_mode);
default:
return false;
}

Powered by Google App Engine
This is Rietveld 408576698