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

Side by Side Diff: src/parsing/parser-base.h

Issue 2567343004: [parser] Fix bug with non-static name method/property (Closed)
Patch Set: 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 | « no previous file | test/mjsunit/es6/function-name.js » ('j') | test/mjsunit/es6/function-name.js » ('J')
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_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 name_expression = ParsePropertyName( 2170 name_expression = ParsePropertyName(
2171 &name, &kind, &is_generator, &is_get, &is_set, &is_async, 2171 &name, &kind, &is_generator, &is_get, &is_set, &is_async,
2172 is_computed_name, CHECK_OK_CUSTOM(EmptyClassLiteralProperty)); 2172 is_computed_name, CHECK_OK_CUSTOM(EmptyClassLiteralProperty));
2173 } 2173 }
2174 } else { 2174 } else {
2175 name_expression = ParsePropertyName( 2175 name_expression = ParsePropertyName(
2176 &name, &kind, &is_generator, &is_get, &is_set, &is_async, 2176 &name, &kind, &is_generator, &is_get, &is_set, &is_async,
2177 is_computed_name, CHECK_OK_CUSTOM(EmptyClassLiteralProperty)); 2177 is_computed_name, CHECK_OK_CUSTOM(EmptyClassLiteralProperty));
2178 } 2178 }
2179 2179
2180 if (!*has_name_static_property && is_static && impl()->IsName(name)) { 2180 if (!*has_name_static_property && *is_static && impl()->IsName(name)) {
2181 *has_name_static_property = true; 2181 *has_name_static_property = true;
2182 } 2182 }
2183 2183
2184 switch (kind) { 2184 switch (kind) {
2185 case PropertyKind::kClassField: 2185 case PropertyKind::kClassField:
2186 case PropertyKind::kNotSet: // This case is a name followed by a name or 2186 case PropertyKind::kNotSet: // This case is a name followed by a name or
2187 // other property. Here we have to assume 2187 // other property. Here we have to assume
2188 // that's an uninitialized field followed by a 2188 // that's an uninitialized field followed by a
2189 // linebreak followed by a property, with ASI 2189 // linebreak followed by a property, with ASI
2190 // adding the semicolon. If not, there will be 2190 // adding the semicolon. If not, there will be
(...skipping 3311 matching lines...) Expand 10 before | Expand all | Expand 10 after
5502 has_seen_constructor_ = true; 5502 has_seen_constructor_ = true;
5503 return; 5503 return;
5504 } 5504 }
5505 } 5505 }
5506 5506
5507 5507
5508 } // namespace internal 5508 } // namespace internal
5509 } // namespace v8 5509 } // namespace v8
5510 5510
5511 #endif // V8_PARSING_PARSER_BASE_H 5511 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/function-name.js » ('j') | test/mjsunit/es6/function-name.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698