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

Unified Diff: src/preparser.h

Issue 8306024: Make native syntax an early error in the preparser. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Unified enums Created 9 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 | « 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 cb1d5fb4eb7baa65ef4d8c8973cb067796e9ce6d..0f5ad7e28e5508e4e54b3dcfbf9ded6cfc7765c5 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -118,9 +118,12 @@ class PreParser {
// during parsing.
static PreParseResult PreParseProgram(i::JavaScriptScanner* scanner,
i::ParserRecorder* log,
- bool allow_lazy,
+ int flags,
uintptr_t stack_limit) {
- return PreParser(scanner, log, stack_limit, allow_lazy).PreParse();
+ bool allow_lazy = (flags & i::kAllowLazy) != 0;
+ bool allow_natives_syntax = (flags & i::kAllowNativesSyntax) != 0;
+ return PreParser(scanner, log, stack_limit,
+ allow_lazy, allow_natives_syntax).PreParse();
}
private:
@@ -437,7 +440,8 @@ class PreParser {
PreParser(i::JavaScriptScanner* scanner,
i::ParserRecorder* log,
uintptr_t stack_limit,
- bool allow_lazy)
+ bool allow_lazy,
+ bool allow_natives_syntax)
: scanner_(scanner),
log_(log),
scope_(NULL),
@@ -445,7 +449,8 @@ class PreParser {
strict_mode_violation_location_(i::Scanner::Location::invalid()),
strict_mode_violation_type_(NULL),
stack_overflow_(false),
- allow_lazy_(true),
+ allow_lazy_(allow_lazy),
+ allow_natives_syntax_(allow_natives_syntax),
parenthesized_function_(false),
harmony_scoping_(scanner->HarmonyScoping()) { }
@@ -607,6 +612,7 @@ class PreParser {
const char* strict_mode_violation_type_;
bool stack_overflow_;
bool allow_lazy_;
+ bool allow_natives_syntax_;
bool parenthesized_function_;
bool harmony_scoping_;
};
« 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