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

Unified Diff: src/parser.h

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased (w/ conflicts) 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/objects-inl.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 15a9a0e62af9985713062d2501f5639c90c14277..ddb542de35cb5492d9afdf350bd504b772475bbb 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -31,7 +31,7 @@ class FunctionEntry BASE_EMBEDDED {
kEndPositionIndex,
kLiteralCountIndex,
kPropertyCountIndex,
- kStrictModeIndex,
+ kLanguageModeIndex,
kSize
};
@@ -44,10 +44,9 @@ class FunctionEntry BASE_EMBEDDED {
int end_pos() { return backing_[kEndPositionIndex]; }
int literal_count() { return backing_[kLiteralCountIndex]; }
int property_count() { return backing_[kPropertyCountIndex]; }
- StrictMode strict_mode() {
- DCHECK(backing_[kStrictModeIndex] == SLOPPY ||
- backing_[kStrictModeIndex] == STRICT);
- return static_cast<StrictMode>(backing_[kStrictModeIndex]);
+ LanguageMode language_mode() {
+ DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex]));
+ return static_cast<LanguageMode>(backing_[kLanguageModeIndex]);
}
bool is_valid() { return !backing_.is_empty(); }
@@ -671,7 +670,7 @@ class Parser : public ParserBase<ParserTraits> {
Parser parser(info, &parse_info);
parser.set_allow_lazy(allow_lazy);
if (parser.Parse()) {
- info->SetStrictMode(info->function()->strict_mode());
+ info->SetLanguageMode(info->function()->language_mode());
return true;
}
return false;
« no previous file with comments | « src/objects-inl.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698