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

Side by Side Diff: src/parser.cc

Issue 1092503003: [es6] Make ParseSuperExpression uses scopes instead (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add commented out js test 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/ast.cc ('k') | src/preparser.h » ('j') | src/preparser.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 DCHECK(info->language_mode() == shared_info->language_mode()); 1121 DCHECK(info->language_mode() == shared_info->language_mode());
1122 scope->SetLanguageMode(shared_info->language_mode()); 1122 scope->SetLanguageMode(shared_info->language_mode());
1123 FunctionLiteral::FunctionType function_type = shared_info->is_expression() 1123 FunctionLiteral::FunctionType function_type = shared_info->is_expression()
1124 ? (shared_info->is_anonymous() 1124 ? (shared_info->is_anonymous()
1125 ? FunctionLiteral::ANONYMOUS_EXPRESSION 1125 ? FunctionLiteral::ANONYMOUS_EXPRESSION
1126 : FunctionLiteral::NAMED_EXPRESSION) 1126 : FunctionLiteral::NAMED_EXPRESSION)
1127 : FunctionLiteral::DECLARATION; 1127 : FunctionLiteral::DECLARATION;
1128 bool ok = true; 1128 bool ok = true;
1129 1129
1130 if (shared_info->is_arrow()) { 1130 if (shared_info->is_arrow()) {
1131 Scope* scope = NewScope(scope_, ARROW_SCOPE); 1131 Scope* scope =
1132 NewScope(scope_, ARROW_SCOPE, FunctionKind::kArrowFunction);
1132 scope->set_start_position(shared_info->start_position()); 1133 scope->set_start_position(shared_info->start_position());
1133 FormalParameterErrorLocations error_locs; 1134 FormalParameterErrorLocations error_locs;
1134 bool has_rest = false; 1135 bool has_rest = false;
1135 if (Check(Token::LPAREN)) { 1136 if (Check(Token::LPAREN)) {
1136 // '(' StrictFormalParameters ')' 1137 // '(' StrictFormalParameters ')'
1137 ParseFormalParameterList(scope, &error_locs, &has_rest, &ok); 1138 ParseFormalParameterList(scope, &error_locs, &has_rest, &ok);
1138 if (ok) ok = Check(Token::RPAREN); 1139 if (ok) ok = Check(Token::RPAREN);
1139 } else { 1140 } else {
1140 // BindingIdentifier 1141 // BindingIdentifier
1141 ParseFormalParameter(scope, &error_locs, has_rest, &ok); 1142 ParseFormalParameter(scope, &error_locs, has_rest, &ok);
(...skipping 4667 matching lines...) Expand 10 before | Expand all | Expand 10 after
5809 5810
5810 Expression* Parser::SpreadCallNew(Expression* function, 5811 Expression* Parser::SpreadCallNew(Expression* function,
5811 ZoneList<v8::internal::Expression*>* args, 5812 ZoneList<v8::internal::Expression*>* args,
5812 int pos) { 5813 int pos) {
5813 args->InsertAt(0, function, zone()); 5814 args->InsertAt(0, function, zone());
5814 5815
5815 return factory()->NewCallRuntime( 5816 return factory()->NewCallRuntime(
5816 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 5817 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
5817 } 5818 }
5818 } } // namespace v8::internal 5819 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/preparser.h » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698