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

Unified Diff: src/parser.h

Issue 1263563002: Correct handling of temporaries as parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 87269ed619581862cb4038173286a1c4b0d42b28..c5bee739475532642c2f57a6ce58419052132afc 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -1318,8 +1318,9 @@ void ParserTraits::DeclareFormalParameter(
const AstRawString* name = is_simple
? pattern->AsVariableProxy()->raw_name()
: parser_->ast_value_factory()->empty_string();
+ VariableMode mode = is_simple ? VAR : TEMPORARY;
Variable* var =
- parameters->scope->DeclareParameter(name, VAR, is_rest, &is_duplicate);
+ parameters->scope->DeclareParameter(name, mode, is_rest, &is_duplicate);
parameters->AddParameter(var, is_simple ? nullptr : pattern);
if (is_duplicate) {
classifier->RecordDuplicateFormalParameterError(
« no previous file with comments | « no previous file | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698