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

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

Issue 2172723003: [cleanup] Remove some leftover strong mode code from the parser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 741
742 742
743 PreParser::Statement PreParser::ParseReturnStatement(bool* ok) { 743 PreParser::Statement PreParser::ParseReturnStatement(bool* ok) {
744 // ReturnStatement :: 744 // ReturnStatement ::
745 // 'return' [no line terminator] Expression? ';' 745 // 'return' [no line terminator] Expression? ';'
746 746
747 // Consume the return token. It is necessary to do before 747 // Consume the return token. It is necessary to do before
748 // reporting any errors on it, because of the way errors are 748 // reporting any errors on it, because of the way errors are
749 // reported (underlining). 749 // reported (underlining).
750 Expect(Token::RETURN, CHECK_OK); 750 Expect(Token::RETURN, CHECK_OK);
751 function_state_->set_return_location(scanner()->location());
752 751
753 // An ECMAScript program is considered syntactically incorrect if it 752 // An ECMAScript program is considered syntactically incorrect if it
754 // contains a return statement that is not within the body of a 753 // contains a return statement that is not within the body of a
755 // function. See ECMA-262, section 12.9, page 67. 754 // function. See ECMA-262, section 12.9, page 67.
756 // This is not handled during preparsing. 755 // This is not handled during preparsing.
757 756
758 Token::Value tok = peek(); 757 Token::Value tok = peek();
759 if (!scanner()->HasAnyLineTerminatorBeforeNext() && 758 if (!scanner()->HasAnyLineTerminatorBeforeNext() &&
760 tok != Token::SEMICOLON && 759 tok != Token::SEMICOLON &&
761 tok != Token::RBRACE && 760 tok != Token::RBRACE &&
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 1317
1319 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); 1318 body->Add(PreParserStatement::ExpressionStatement(return_value), zone());
1320 } 1319 }
1321 1320
1322 #undef CHECK_OK 1321 #undef CHECK_OK
1323 #undef CHECK_OK_CUSTOM 1322 #undef CHECK_OK_CUSTOM
1324 1323
1325 1324
1326 } // namespace internal 1325 } // namespace internal
1327 } // namespace v8 1326 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698