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

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

Issue 2313723005: [parser] Simplify parse-time function name inference for properties (Closed)
Patch Set: Created 4 years, 3 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/preparser.h ('k') | test/mjsunit/es6/function-name.js » ('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 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 } 849 }
850 850
851 ClassLiteralChecker checker(this); 851 ClassLiteralChecker checker(this);
852 bool has_seen_constructor = false; 852 bool has_seen_constructor = false;
853 853
854 Expect(Token::LBRACE, CHECK_OK); 854 Expect(Token::LBRACE, CHECK_OK);
855 while (peek() != Token::RBRACE) { 855 while (peek() != Token::RBRACE) {
856 if (Check(Token::SEMICOLON)) continue; 856 if (Check(Token::SEMICOLON)) continue;
857 bool is_computed_name = false; // Classes do not care about computed 857 bool is_computed_name = false; // Classes do not care about computed
858 // property names here. 858 // property names here.
859 Identifier name;
860 ExpressionClassifier property_classifier(this); 859 ExpressionClassifier property_classifier(this);
861 ParseClassPropertyDefinition(&checker, has_extends, &is_computed_name, 860 ParseClassPropertyDefinition(&checker, has_extends, &is_computed_name,
862 &has_seen_constructor, &name, CHECK_OK); 861 &has_seen_constructor, CHECK_OK);
863 ValidateExpression(CHECK_OK); 862 ValidateExpression(CHECK_OK);
864 impl()->AccumulateFormalParameterContainmentErrors(); 863 impl()->AccumulateFormalParameterContainmentErrors();
865 } 864 }
866 865
867 Expect(Token::RBRACE, CHECK_OK); 866 Expect(Token::RBRACE, CHECK_OK);
868 867
869 return Expression::Default(); 868 return Expression::Default();
870 } 869 }
871 870
872 871
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 912
914 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); 913 body->Add(PreParserStatement::ExpressionStatement(return_value), zone());
915 } 914 }
916 915
917 #undef CHECK_OK 916 #undef CHECK_OK
918 #undef CHECK_OK_CUSTOM 917 #undef CHECK_OK_CUSTOM
919 918
920 919
921 } // namespace internal 920 } // namespace internal
922 } // namespace v8 921 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | test/mjsunit/es6/function-name.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698