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

Unified Diff: src/parsing/parser.cc

Issue 2009963002: [modules] Disable HTML-like comments Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unify behavior for optimized and non-optimized executions Created 4 years, 7 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/parsing/scanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index e31cb0934ee94de2b11da7a44b2a2f722585b034..8e3d4cdfaad2df05cd3cecee094c03886192385a 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -71,6 +71,7 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
set_stack_limit(isolate_->stack_guard()->real_climit());
set_unicode_cache(isolate_->unicode_cache());
set_language_mode(shared->language_mode());
+ set_module(shared->within_module());
set_shared_info(shared);
Handle<Script> script(Script::cast(shared->script()));
@@ -853,11 +854,11 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
// identical calls.
ExternalTwoByteStringUtf16CharacterStream stream(
Handle<ExternalTwoByteString>::cast(source), 0, source->length());
- scanner_.Initialize(&stream);
+ scanner_.Initialize(&stream, !info->is_module());
result = DoParseProgram(info);
} else {
GenericStringUtf16CharacterStream stream(source, 0, source->length());
- scanner_.Initialize(&stream);
+ scanner_.Initialize(&stream, !info->is_module());
result = DoParseProgram(info);
}
if (result != NULL) {
@@ -1044,7 +1045,7 @@ static FunctionLiteral::FunctionType ComputeFunctionType(
FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info,
Utf16CharacterStream* source) {
Handle<SharedFunctionInfo> shared_info = info->shared_info();
- scanner_.Initialize(source);
+ scanner_.Initialize(source, !info->is_module());
DCHECK(scope_ == NULL);
DCHECK(target_stack_ == NULL);
@@ -5255,7 +5256,7 @@ void Parser::ParseOnBackground(ParseInfo* info) {
DCHECK(info->source_stream() != NULL);
ExternalStreamingStream stream(info->source_stream(),
info->source_stream_encoding());
- scanner_.Initialize(&stream);
+ scanner_.Initialize(&stream, !info->is_module());
DCHECK(info->context().is_null() || info->context()->IsNativeContext());
// When streaming, we don't know the length of the source until we have parsed
« no previous file with comments | « src/objects-inl.h ('k') | src/parsing/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698