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

Unified Diff: src/parsing/parser.cc

Issue 1817353007: Fix "use types" directive in modules (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@types
Patch Set: Created 4 years, 9 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 | test/cctest/test-parsing.cc » ('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 62e03631856b6a82935593f57c604d446a865c2e..33934c23fdf58a4ddc61bbb9880cedc4c8ca294e 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1356,6 +1356,13 @@ void* Parser::ParseModuleItemList(ZoneList<Statement*>* body, bool* ok) {
// incremented after parsing is done.
++use_counts_[v8::Isolate::kUseAsm];
scope_->SetAsmModule();
+ // Check "use types".
+ } else if (allow_harmony_types() &&
+ literal->raw_value()->AsString() ==
+ ast_value_factory()->use_types_string() &&
+ token_loc.end_pos - token_loc.beg_pos ==
+ ast_value_factory()->use_types_string()->length() + 2) {
+ scope_->SetTyped();
}
} else {
// End of the directive prologue.
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698