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

Side by Side Diff: src/preparser.h

Issue 1235153006: [es6] re-implement rest parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More/fewer removals Created 5 years, 5 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 3637 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 if (!*ok) return -1; 3648 if (!*ok) return -1;
3649 } while (!parsing_state->has_rest && Check(Token::COMMA)); 3649 } while (!parsing_state->has_rest && Check(Token::COMMA));
3650 3650
3651 if (parsing_state->has_rest && peek() == Token::COMMA) { 3651 if (parsing_state->has_rest && peek() == Token::COMMA) {
3652 ReportMessageAt(scanner()->peek_location(), 3652 ReportMessageAt(scanner()->peek_location(),
3653 MessageTemplate::kParamAfterRest); 3653 MessageTemplate::kParamAfterRest);
3654 *ok = false; 3654 *ok = false;
3655 return -1; 3655 return -1;
3656 } 3656 }
3657 } 3657 }
3658
3659 return parameter_count; 3658 return parameter_count;
3660 } 3659 }
3661 3660
3662 3661
3663 template <class Traits> 3662 template <class Traits>
3664 void ParserBase<Traits>::CheckArityRestrictions( 3663 void ParserBase<Traits>::CheckArityRestrictions(
3665 int param_count, FunctionLiteral::ArityRestriction arity_restriction, 3664 int param_count, FunctionLiteral::ArityRestriction arity_restriction,
3666 bool has_rest, int formals_start_pos, int formals_end_pos, bool* ok) { 3665 bool has_rest, int formals_start_pos, int formals_end_pos, bool* ok) {
3667 switch (arity_restriction) { 3666 switch (arity_restriction) {
3668 case FunctionLiteral::GETTER_ARITY: 3667 case FunctionLiteral::GETTER_ARITY:
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
3980 *ok = false; 3979 *ok = false;
3981 return; 3980 return;
3982 } 3981 }
3983 has_seen_constructor_ = true; 3982 has_seen_constructor_ = true;
3984 return; 3983 return;
3985 } 3984 }
3986 } 3985 }
3987 } } // v8::internal 3986 } } // v8::internal
3988 3987
3989 #endif // V8_PREPARSER_H 3988 #endif // V8_PREPARSER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698