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

Side by Side Diff: src/preparser.h

Issue 1423613002: Fix eval calls in initializers of arrow function parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment, rebase Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/scopes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/bailout-reason.h" 8 #include "src/bailout-reason.h"
9 #include "src/expression-classifier.h" 9 #include "src/expression-classifier.h"
10 #include "src/func-name-inferrer.h" 10 #include "src/func-name-inferrer.h"
(...skipping 2924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2935 } 2935 }
2936 ExpressionT expression = this->ParseConditionalExpression( 2936 ExpressionT expression = this->ParseConditionalExpression(
2937 accept_IN, &arrow_formals_classifier, CHECK_OK); 2937 accept_IN, &arrow_formals_classifier, CHECK_OK);
2938 if (peek() == Token::ARROW) { 2938 if (peek() == Token::ARROW) {
2939 BindingPatternUnexpectedToken(classifier); 2939 BindingPatternUnexpectedToken(classifier);
2940 ValidateArrowFormalParameters(&arrow_formals_classifier, expression, 2940 ValidateArrowFormalParameters(&arrow_formals_classifier, expression,
2941 parenthesized_formals, CHECK_OK); 2941 parenthesized_formals, CHECK_OK);
2942 Scanner::Location loc(lhs_beg_pos, scanner()->location().end_pos); 2942 Scanner::Location loc(lhs_beg_pos, scanner()->location().end_pos);
2943 Scope* scope = 2943 Scope* scope =
2944 this->NewScope(scope_, FUNCTION_SCOPE, FunctionKind::kArrowFunction); 2944 this->NewScope(scope_, FUNCTION_SCOPE, FunctionKind::kArrowFunction);
2945 // Because the arrow's parameters were parsed in the outer scope, any
2946 // usage flags that might have been triggered there need to be copied
2947 // to the arrow scope.
2948 scope_->PropagateUsageFlagsToScope(scope);
2945 FormalParametersT parameters(scope); 2949 FormalParametersT parameters(scope);
2946 if (!arrow_formals_classifier.is_simple_parameter_list()) { 2950 if (!arrow_formals_classifier.is_simple_parameter_list()) {
2947 scope->SetHasNonSimpleParameters(); 2951 scope->SetHasNonSimpleParameters();
2948 parameters.is_simple = false; 2952 parameters.is_simple = false;
2949 } 2953 }
2950 2954
2951 Scanner::Location duplicate_loc = Scanner::Location::invalid(); 2955 Scanner::Location duplicate_loc = Scanner::Location::invalid();
2952 this->ParseArrowFunctionFormalParameterList(&parameters, expression, loc, 2956 this->ParseArrowFunctionFormalParameterList(&parameters, expression, loc,
2953 &duplicate_loc, CHECK_OK); 2957 &duplicate_loc, CHECK_OK);
2954 2958
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
4200 return; 4204 return;
4201 } 4205 }
4202 has_seen_constructor_ = true; 4206 has_seen_constructor_ = true;
4203 return; 4207 return;
4204 } 4208 }
4205 } 4209 }
4206 } // namespace internal 4210 } // namespace internal
4207 } // namespace v8 4211 } // namespace v8
4208 4212
4209 #endif // V8_PREPARSER_H 4213 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « no previous file | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698