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

Unified Diff: src/compiler.cc

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 | « no previous file | src/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 544d1904f95ec3f6a1b6a5ba2159cf98db34793b..3f5f009e911a7635294fc3f377de34e6eccf8011 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -480,20 +480,22 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
// that would be compiled lazily anyway, so we skip the preparse step
// in that case too.
ScriptDataImpl* pre_data = input_pre_data;
- bool harmony_scoping = natives != NATIVES_CODE && FLAG_harmony_scoping;
+ int flags = kNoParsingFlags;
+ if ((natives == NATIVES_CODE) || FLAG_allow_natives_syntax) {
+ flags |= kAllowNativesSyntax;
+ }
+ if (natives != NATIVES_CODE && FLAG_harmony_scoping) {
+ flags |= kHarmonyScoping;
+ }
if (pre_data == NULL
&& source_length >= FLAG_min_preparse_length) {
if (source->IsExternalTwoByteString()) {
ExternalTwoByteStringUC16CharacterStream stream(
Handle<ExternalTwoByteString>::cast(source), 0, source->length());
- pre_data = ParserApi::PartialPreParse(&stream,
- extension,
- harmony_scoping);
+ pre_data = ParserApi::PartialPreParse(&stream, extension, flags);
} else {
GenericStringUC16CharacterStream stream(source, 0, source->length());
- pre_data = ParserApi::PartialPreParse(&stream,
- extension,
- harmony_scoping);
+ pre_data = ParserApi::PartialPreParse(&stream, extension, flags);
}
}
« no previous file with comments | « no previous file | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698