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

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: 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
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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 return PreParserExpression::Default(); 1189 return PreParserExpression::Default();
1190 } 1190 }
1191 PreParserStatement NewReturnStatement(PreParserExpression expression, 1191 PreParserStatement NewReturnStatement(PreParserExpression expression,
1192 int pos) { 1192 int pos) {
1193 return PreParserStatement::Default(); 1193 return PreParserStatement::Default();
1194 } 1194 }
1195 PreParserExpression NewFunctionLiteral( 1195 PreParserExpression NewFunctionLiteral(
1196 PreParserIdentifier name, AstValueFactory* ast_value_factory, 1196 PreParserIdentifier name, AstValueFactory* ast_value_factory,
1197 Scope* scope, PreParserStatementList body, int materialized_literal_count, 1197 Scope* scope, PreParserStatementList body, int materialized_literal_count,
1198 int expected_property_count, int handler_count, int parameter_count, 1198 int expected_property_count, int handler_count, int parameter_count,
1199 PreParserExpressionList default_values,
1199 FunctionLiteral::ParameterFlag has_duplicate_parameters, 1200 FunctionLiteral::ParameterFlag has_duplicate_parameters,
1200 FunctionLiteral::FunctionType function_type, 1201 FunctionLiteral::FunctionType function_type,
1201 FunctionLiteral::IsFunctionFlag is_function, 1202 FunctionLiteral::IsFunctionFlag is_function,
1202 FunctionLiteral::IsParenthesizedFlag is_parenthesized, FunctionKind kind, 1203 FunctionLiteral::IsParenthesizedFlag is_parenthesized, FunctionKind kind,
1203 int position) { 1204 int position) {
1204 return PreParserExpression::Default(); 1205 return PreParserExpression::Default();
1205 } 1206 }
1206 1207
1207 PreParserExpression NewSpread(PreParserExpression expression, int pos) { 1208 PreParserExpression NewSpread(PreParserExpression expression, int pos) {
1208 return PreParserExpression::Spread(expression); 1209 return PreParserExpression::Spread(expression);
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after
3068 eval_args_error_loc, dupe_error_loc, reserved_loc, CHECK_OK); 3069 eval_args_error_loc, dupe_error_loc, reserved_loc, CHECK_OK);
3069 3070
3070 // Validate strict mode. 3071 // Validate strict mode.
3071 if (is_strict(language_mode())) { 3072 if (is_strict(language_mode())) {
3072 CheckStrictOctalLiteral(start_pos, scanner()->location().end_pos, 3073 CheckStrictOctalLiteral(start_pos, scanner()->location().end_pos,
3073 CHECK_OK); 3074 CHECK_OK);
3074 this->CheckConflictingVarDeclarations(scope, CHECK_OK); 3075 this->CheckConflictingVarDeclarations(scope, CHECK_OK);
3075 } 3076 }
3076 } 3077 }
3077 3078
3079 typename Traits::Type::ExpressionList default_values =
3080 this->NewExpressionList(0, zone_);
3078 FunctionLiteralT function_literal = factory()->NewFunctionLiteral( 3081 FunctionLiteralT function_literal = factory()->NewFunctionLiteral(
3079 this->EmptyIdentifierString(), ast_value_factory(), scope, body, 3082 this->EmptyIdentifierString(), ast_value_factory(), scope, body,
3080 materialized_literal_count, expected_property_count, handler_count, 3083 materialized_literal_count, expected_property_count, handler_count,
3081 num_parameters, FunctionLiteral::kNoDuplicateParameters, 3084 num_parameters, default_values, FunctionLiteral::kNoDuplicateParameters,
3082 FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction, 3085 FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction,
3083 FunctionLiteral::kNotParenthesized, FunctionKind::kArrowFunction, 3086 FunctionLiteral::kNotParenthesized, FunctionKind::kArrowFunction,
3084 start_pos); 3087 start_pos);
3085 3088
3086 function_literal->set_function_token_position(start_pos); 3089 function_literal->set_function_token_position(start_pos);
3087 if (super_loc.IsValid()) function_state_->set_super_call_location(super_loc); 3090 if (super_loc.IsValid()) function_state_->set_super_call_location(super_loc);
3088 3091
3089 if (fni_ != NULL) this->InferFunctionName(fni_, function_literal); 3092 if (fni_ != NULL) this->InferFunctionName(fni_, function_literal);
3090 3093
3091 return function_literal; 3094 return function_literal;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
3262 *ok = false; 3265 *ok = false;
3263 return; 3266 return;
3264 } 3267 }
3265 has_seen_constructor_ = true; 3268 has_seen_constructor_ = true;
3266 return; 3269 return;
3267 } 3270 }
3268 } 3271 }
3269 } } // v8::internal 3272 } } // v8::internal
3270 3273
3271 #endif // V8_PREPARSER_H 3274 #endif // V8_PREPARSER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698