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

Side by Side Diff: src/parser.cc

Issue 1141223002: [parser] report SyntaxError if rest parameter used in Setter MethodDefinition (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add cctest Created 5 years, 7 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/messages.h ('k') | src/preparser.h » ('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 #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 3874 matching lines...) Expand 10 before | Expand all | Expand 10 after
3885 3885
3886 bool has_rest = false; 3886 bool has_rest = false;
3887 Expect(Token::LPAREN, CHECK_OK); 3887 Expect(Token::LPAREN, CHECK_OK);
3888 int start_position = scanner()->location().beg_pos; 3888 int start_position = scanner()->location().beg_pos;
3889 scope_->set_start_position(start_position); 3889 scope_->set_start_position(start_position);
3890 num_parameters = ParseFormalParameterList(scope, &has_rest, 3890 num_parameters = ParseFormalParameterList(scope, &has_rest,
3891 &formals_classifier, CHECK_OK); 3891 &formals_classifier, CHECK_OK);
3892 Expect(Token::RPAREN, CHECK_OK); 3892 Expect(Token::RPAREN, CHECK_OK);
3893 int formals_end_position = scanner()->location().end_pos; 3893 int formals_end_position = scanner()->location().end_pos;
3894 3894
3895 CheckArityRestrictions(num_parameters, arity_restriction, start_position, 3895 CheckArityRestrictions(num_parameters, arity_restriction, has_rest,
3896 formals_end_position, CHECK_OK); 3896 start_position, formals_end_position, CHECK_OK);
3897 3897
3898 Expect(Token::LBRACE, CHECK_OK); 3898 Expect(Token::LBRACE, CHECK_OK);
3899 3899
3900 // If we have a named function expression, we add a local variable 3900 // If we have a named function expression, we add a local variable
3901 // declaration to the body of the function with the name of the 3901 // declaration to the body of the function with the name of the
3902 // function and let it refer to the function itself (closure). 3902 // function and let it refer to the function itself (closure).
3903 // NOTE: We create a proxy and resolve it here so that in the 3903 // NOTE: We create a proxy and resolve it here so that in the
3904 // future we can change the AST to only refer to VariableProxies 3904 // future we can change the AST to only refer to VariableProxies
3905 // instead of Variables and Proxis as is the case now. 3905 // instead of Variables and Proxis as is the case now.
3906 Variable* fvar = NULL; 3906 Variable* fvar = NULL;
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
5760 5760
5761 Expression* Parser::SpreadCallNew(Expression* function, 5761 Expression* Parser::SpreadCallNew(Expression* function,
5762 ZoneList<v8::internal::Expression*>* args, 5762 ZoneList<v8::internal::Expression*>* args,
5763 int pos) { 5763 int pos) {
5764 args->InsertAt(0, function, zone()); 5764 args->InsertAt(0, function, zone());
5765 5765
5766 return factory()->NewCallRuntime( 5766 return factory()->NewCallRuntime(
5767 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 5767 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
5768 } 5768 }
5769 } } // namespace v8::internal 5769 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698