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

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: Fix build 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') | src/scopes.h » ('J')
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 2938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2949 } 2949 }
2950 ExpressionT expression = this->ParseConditionalExpression( 2950 ExpressionT expression = this->ParseConditionalExpression(
2951 accept_IN, &arrow_formals_classifier, CHECK_OK); 2951 accept_IN, &arrow_formals_classifier, CHECK_OK);
2952 if (peek() == Token::ARROW) { 2952 if (peek() == Token::ARROW) {
2953 BindingPatternUnexpectedToken(classifier); 2953 BindingPatternUnexpectedToken(classifier);
2954 ValidateArrowFormalParameters(&arrow_formals_classifier, expression, 2954 ValidateArrowFormalParameters(&arrow_formals_classifier, expression,
2955 parenthesized_formals, CHECK_OK); 2955 parenthesized_formals, CHECK_OK);
2956 Scanner::Location loc(lhs_beg_pos, scanner()->location().end_pos); 2956 Scanner::Location loc(lhs_beg_pos, scanner()->location().end_pos);
2957 Scope* scope = 2957 Scope* scope =
2958 this->NewScope(scope_, FUNCTION_SCOPE, FunctionKind::kArrowFunction); 2958 this->NewScope(scope_, FUNCTION_SCOPE, FunctionKind::kArrowFunction);
2959 scope_->PropagateUsageFlagsToScope(scope);
2959 FormalParametersT parameters(scope); 2960 FormalParametersT parameters(scope);
2960 if (!arrow_formals_classifier.is_simple_parameter_list()) { 2961 if (!arrow_formals_classifier.is_simple_parameter_list()) {
2961 scope->SetHasNonSimpleParameters(); 2962 scope->SetHasNonSimpleParameters();
2962 parameters.is_simple = false; 2963 parameters.is_simple = false;
2963 } 2964 }
2964 2965
2965 Scanner::Location duplicate_loc = Scanner::Location::invalid(); 2966 Scanner::Location duplicate_loc = Scanner::Location::invalid();
2966 this->ParseArrowFunctionFormalParameterList(&parameters, expression, loc, 2967 this->ParseArrowFunctionFormalParameterList(&parameters, expression, loc,
2967 &duplicate_loc, CHECK_OK); 2968 &duplicate_loc, CHECK_OK);
2968 2969
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
4214 return; 4215 return;
4215 } 4216 }
4216 has_seen_constructor_ = true; 4217 has_seen_constructor_ = true;
4217 return; 4218 return;
4218 } 4219 }
4219 } 4220 }
4220 } // namespace internal 4221 } // namespace internal
4221 } // namespace v8 4222 } // namespace v8
4222 4223
4223 #endif // V8_PREPARSER_H 4224 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « no previous file | src/scopes.h » ('j') | src/scopes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698