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

Side by Side Diff: src/parsing/preparser.h

Issue 2510873005: A decimal integer literal with a leading 0 is now an error in strict mode. (Closed)
Patch Set: implementation without error message changes Created 4 years 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/parsing/parser-base.h ('k') | src/parsing/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_PARSING_PREPARSER_H 5 #ifndef V8_PARSING_PREPARSER_H
6 #define V8_PARSING_PREPARSER_H 6 #define V8_PARSING_PREPARSER_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/parsing/parser-base.h" 9 #include "src/parsing/parser-base.h"
10 #include "src/parsing/preparse-data.h" 10 #include "src/parsing/preparse-data.h"
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 int start_position = scanner()->peek_location().beg_pos; 875 int start_position = scanner()->peek_location().beg_pos;
876 parsing_module_ = is_module; 876 parsing_module_ = is_module;
877 PreParserStatementList body; 877 PreParserStatementList body;
878 ParseStatementList(body, Token::EOS, &ok); 878 ParseStatementList(body, Token::EOS, &ok);
879 if (stack_overflow()) return kPreParseStackOverflow; 879 if (stack_overflow()) return kPreParseStackOverflow;
880 if (!ok) { 880 if (!ok) {
881 ReportUnexpectedToken(scanner()->current_token()); 881 ReportUnexpectedToken(scanner()->current_token());
882 } else if (is_strict(this->scope()->language_mode())) { 882 } else if (is_strict(this->scope()->language_mode())) {
883 CheckStrictOctalLiteral(start_position, scanner()->location().end_pos, 883 CheckStrictOctalLiteral(start_position, scanner()->location().end_pos,
884 &ok); 884 &ok);
885 CheckDecimalLiteralWithLeadingZero(start_position,
886 scanner()->location().end_pos);
887 } 885 }
888 if (materialized_literals) { 886 if (materialized_literals) {
889 *materialized_literals = function_state_->materialized_literal_count(); 887 *materialized_literals = function_state_->materialized_literal_count();
890 } 888 }
891 return kPreParseSuccess; 889 return kPreParseSuccess;
892 } 890 }
893 891
894 // Parses a single function literal, from the opening parentheses before 892 // Parses a single function literal, from the opening parentheses before
895 // parameters to the closing brace after the body. 893 // parameters to the closing brace after the body.
896 // Returns a FunctionEntry describing the body of the function in enough 894 // Returns a FunctionEntry describing the body of the function in enough
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 function_state_->NextMaterializedLiteralIndex(); 1583 function_state_->NextMaterializedLiteralIndex();
1586 function_state_->NextMaterializedLiteralIndex(); 1584 function_state_->NextMaterializedLiteralIndex();
1587 } 1585 }
1588 return EmptyExpression(); 1586 return EmptyExpression();
1589 } 1587 }
1590 1588
1591 } // namespace internal 1589 } // namespace internal
1592 } // namespace v8 1590 } // namespace v8
1593 1591
1594 #endif // V8_PARSING_PREPARSER_H 1592 #endif // V8_PARSING_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698