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

Unified Diff: src/parsing/parser-base.h

Issue 1634403002: Add ES2015 Function.name support to pattern and default parameter initializers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added parenthesized tests Created 4 years, 11 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/mjsunit/harmony/function-name.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index e4947f208a2fa631dae8d5202ebd722ad8486d86..10c1d5282cce53823c18ff1913b1296c48cd9725 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -1677,6 +1677,10 @@ ParserBase<Traits>::ParsePropertyDefinition(
classifier->RecordCoverInitializedNameError(
Scanner::Location(next_beg_pos, scanner()->location().end_pos),
MessageTemplate::kInvalidCoverInitializedName);
+
+ if (allow_harmony_function_name()) {
+ Traits::SetFunctionNameFromIdentifierRef(rhs, lhs);
+ }
} else {
value = lhs;
}
@@ -2882,6 +2886,10 @@ void ParserBase<Traits>::ParseFormalParameter(
if (!*ok) return;
parameters->is_simple = false;
classifier->RecordNonSimpleParameter();
+
+ if (allow_harmony_function_name()) {
+ Traits::SetFunctionNameFromIdentifierRef(initializer, pattern);
+ }
}
Traits::AddFormalParameter(parameters, pattern, initializer,
« no previous file with comments | « no previous file | test/mjsunit/harmony/function-name.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698