OLD | NEW |
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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/compiler.h" // TODO(titzer): remove this include dependency | 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { | 1324 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
1325 return parser_->SpreadCallNew(function, args, pos); | 1325 return parser_->SpreadCallNew(function, args, pos); |
1326 } | 1326 } |
1327 | 1327 |
1328 | 1328 |
1329 void ParserTraits::AddFormalParameter( | 1329 void ParserTraits::AddFormalParameter( |
1330 ParserFormalParameters* parameters, | 1330 ParserFormalParameters* parameters, |
1331 Expression* pattern, Expression* initializer, bool is_rest) { | 1331 Expression* pattern, Expression* initializer, bool is_rest) { |
1332 bool is_simple = | 1332 bool is_simple = |
1333 !is_rest && pattern->IsVariableProxy() && initializer == nullptr; | 1333 !is_rest && pattern->IsVariableProxy() && initializer == nullptr; |
1334 DCHECK(parser_->allow_harmony_destructuring() || | 1334 DCHECK(parser_->allow_harmony_destructuring_bind() || |
1335 parser_->allow_harmony_rest_parameters() || | 1335 parser_->allow_harmony_rest_parameters() || |
1336 parser_->allow_harmony_default_parameters() || is_simple); | 1336 parser_->allow_harmony_default_parameters() || is_simple); |
1337 const AstRawString* name = is_simple | 1337 const AstRawString* name = is_simple |
1338 ? pattern->AsVariableProxy()->raw_name() | 1338 ? pattern->AsVariableProxy()->raw_name() |
1339 : parser_->ast_value_factory()->empty_string(); | 1339 : parser_->ast_value_factory()->empty_string(); |
1340 parameters->params.Add( | 1340 parameters->params.Add( |
1341 ParserFormalParameters::Parameter(name, pattern, initializer, is_rest), | 1341 ParserFormalParameters::Parameter(name, pattern, initializer, is_rest), |
1342 parameters->scope->zone()); | 1342 parameters->scope->zone()); |
1343 } | 1343 } |
1344 | 1344 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 | 1383 |
1384 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1384 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1385 return parser_->ParseDoExpression(ok); | 1385 return parser_->ParseDoExpression(ok); |
1386 } | 1386 } |
1387 | 1387 |
1388 | 1388 |
1389 } // namespace internal | 1389 } // namespace internal |
1390 } // namespace v8 | 1390 } // namespace v8 |
1391 | 1391 |
1392 #endif // V8_PARSER_H_ | 1392 #endif // V8_PARSER_H_ |
OLD | NEW |