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

Unified Diff: src/preparser.h

Issue 939063002: [strong] Deprecate for-in (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 10 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 | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 1cd5dadf0d13557e9e978c5a0bee07f95680c89c..0f9cb46e0698af356ea238d8403d93fb042c35bc 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -420,6 +420,23 @@ class ParserBase : public Traits {
}
}
+ bool CheckInOrOf(
+ bool accept_OF, ForEachStatement::VisitMode* visit_mode, bool* ok) {
+ if (Check(Token::IN)) {
+ if (is_strong(language_mode())) {
+ ReportMessageAt(scanner()->location(), "strong_for_in");
+ *ok = false;
+ } else {
+ *visit_mode = ForEachStatement::ENUMERATE;
+ }
+ return true;
+ } else if (accept_OF && CheckContextualKeyword(CStrVector("of"))) {
+ *visit_mode = ForEachStatement::ITERATE;
+ return true;
+ }
+ return false;
+ }
+
// Checks whether an octal literal was last seen between beg_pos and end_pos.
// If so, reports an error. Only called for strict mode and template strings.
void CheckOctalLiteral(int beg_pos, int end_pos, const char* error,
@@ -1613,8 +1630,6 @@ class PreParser : public ParserBase<PreParserTraits> {
Scanner::Location class_name_location,
bool name_is_strict_reserved, int pos,
bool* ok);
-
- bool CheckInOrOf(bool accept_OF);
};
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698