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

Unified Diff: src/parser.cc

Issue 949763003: WIP: new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index b1d427e2529f4ec23a4ac702094ba4f874657443..795b56e97a24fbfda86131846e9d02614c49654d 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -676,6 +676,14 @@ Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory,
return factory->NewVariableProxy(scope->receiver(), pos);
}
+
+Expression* ParserTraits::NewTargetExpression(Scope* scope,
+ AstNodeFactory* factory,
+ int pos) {
+ return factory->NewVariableProxy(scope->new_target_var(), pos);
+}
+
+
Expression* ParserTraits::SuperReference(Scope* scope, AstNodeFactory* factory,
int pos) {
return factory->NewSuperReference(
@@ -815,6 +823,7 @@ Parser::Parser(CompilationInfo* info, uintptr_t stack_limit, uint32_t hash_seed,
set_allow_harmony_computed_property_names(
FLAG_harmony_computed_property_names);
set_allow_harmony_rest_params(FLAG_harmony_rest_parameters);
+ set_allow_harmony_new_target(FLAG_harmony_new_target);
set_allow_strong_mode(FLAG_strong_mode);
for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
++feature) {
@@ -3933,7 +3942,7 @@ void Parser::SkipLazyFunctionBody(const AstRawString* function_name,
int body_end = scanner()->location().end_pos;
log_->LogFunction(function_block_pos, body_end, *materialized_literal_count,
*expected_property_count, scope_->language_mode(),
- scope_->uses_super_property());
+ scope_->uses_super_property(), scope_->uses_new_target());
}
}
@@ -4059,6 +4068,8 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
allow_harmony_computed_property_names());
reusable_preparser_->set_allow_harmony_rest_params(
allow_harmony_rest_params());
+ reusable_preparser_->set_allow_harmony_new_target(
+ allow_harmony_new_target());
reusable_preparser_->set_allow_strong_mode(allow_strong_mode());
}
PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction(

Powered by Google App Engine
This is Rietveld 408576698