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

Side by Side Diff: src/preparser.h

Issue 1053773006: [es6] implement default/optional parameters (WIP / comments) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Experimental not-quite-TDZ support Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('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/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 return PreParserExpression::Default(); 1230 return PreParserExpression::Default();
1231 } 1231 }
1232 PreParserStatement NewReturnStatement(PreParserExpression expression, 1232 PreParserStatement NewReturnStatement(PreParserExpression expression,
1233 int pos) { 1233 int pos) {
1234 return PreParserStatement::Default(); 1234 return PreParserStatement::Default();
1235 } 1235 }
1236 PreParserExpression NewFunctionLiteral( 1236 PreParserExpression NewFunctionLiteral(
1237 PreParserIdentifier name, AstValueFactory* ast_value_factory, 1237 PreParserIdentifier name, AstValueFactory* ast_value_factory,
1238 Scope* scope, PreParserStatementList body, int materialized_literal_count, 1238 Scope* scope, PreParserStatementList body, int materialized_literal_count,
1239 int expected_property_count, int handler_count, int parameter_count, 1239 int expected_property_count, int handler_count, int parameter_count,
1240 PreParserExpressionList default_values,
1240 FunctionLiteral::ParameterFlag has_duplicate_parameters, 1241 FunctionLiteral::ParameterFlag has_duplicate_parameters,
1241 FunctionLiteral::FunctionType function_type, 1242 FunctionLiteral::FunctionType function_type,
1242 FunctionLiteral::IsFunctionFlag is_function, 1243 FunctionLiteral::IsFunctionFlag is_function,
1243 FunctionLiteral::IsParenthesizedFlag is_parenthesized, FunctionKind kind, 1244 FunctionLiteral::IsParenthesizedFlag is_parenthesized, FunctionKind kind,
1244 int position) { 1245 int position) {
1245 return PreParserExpression::Default(); 1246 return PreParserExpression::Default();
1246 } 1247 }
1247 1248
1248 PreParserExpression NewSpread(PreParserExpression expression, int pos) { 1249 PreParserExpression NewSpread(PreParserExpression expression, int pos) {
1249 return PreParserExpression::Spread(expression); 1250 return PreParserExpression::Spread(expression);
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after
3123 reserved_loc, CHECK_OK); 3124 reserved_loc, CHECK_OK);
3124 3125
3125 // Validate strict mode. 3126 // Validate strict mode.
3126 if (is_strict(language_mode())) { 3127 if (is_strict(language_mode())) {
3127 CheckStrictOctalLiteral(start_pos, scanner()->location().end_pos, 3128 CheckStrictOctalLiteral(start_pos, scanner()->location().end_pos,
3128 CHECK_OK); 3129 CHECK_OK);
3129 this->CheckConflictingVarDeclarations(scope, CHECK_OK); 3130 this->CheckConflictingVarDeclarations(scope, CHECK_OK);
3130 } 3131 }
3131 } 3132 }
3132 3133
3134 typename Traits::Type::ExpressionList default_values =
3135 this->NewExpressionList(0, zone_);
3133 FunctionLiteralT function_literal = factory()->NewFunctionLiteral( 3136 FunctionLiteralT function_literal = factory()->NewFunctionLiteral(
3134 this->EmptyIdentifierString(), ast_value_factory(), scope, body, 3137 this->EmptyIdentifierString(), ast_value_factory(), scope, body,
3135 materialized_literal_count, expected_property_count, handler_count, 3138 materialized_literal_count, expected_property_count, handler_count,
3136 num_parameters, FunctionLiteral::kNoDuplicateParameters, 3139 num_parameters, default_values, FunctionLiteral::kNoDuplicateParameters,
3137 FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction, 3140 FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction,
3138 FunctionLiteral::kNotParenthesized, FunctionKind::kArrowFunction, 3141 FunctionLiteral::kNotParenthesized, FunctionKind::kArrowFunction,
3139 start_pos); 3142 start_pos);
3140 3143
3141 function_literal->set_function_token_position(start_pos); 3144 function_literal->set_function_token_position(start_pos);
3142 if (super_loc.IsValid()) function_state_->set_super_call_location(super_loc); 3145 if (super_loc.IsValid()) function_state_->set_super_call_location(super_loc);
3143 3146
3144 if (fni_ != NULL) this->InferFunctionName(fni_, function_literal); 3147 if (fni_ != NULL) this->InferFunctionName(fni_, function_literal);
3145 3148
3146 return function_literal; 3149 return function_literal;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
3326 *ok = false; 3329 *ok = false;
3327 return; 3330 return;
3328 } 3331 }
3329 has_seen_constructor_ = true; 3332 has_seen_constructor_ = true;
3330 return; 3333 return;
3331 } 3334 }
3332 } 3335 }
3333 } } // v8::internal 3336 } } // v8::internal
3334 3337
3335 #endif // V8_PREPARSER_H 3338 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698