OLD | NEW |
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/bailout-reason.h" | 8 #include "src/bailout-reason.h" |
9 #include "src/expression-classifier.h" | 9 #include "src/expression-classifier.h" |
10 #include "src/func-name-inferrer.h" | 10 #include "src/func-name-inferrer.h" |
(...skipping 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); | 2648 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); |
2649 | 2649 |
2650 return factory()->NewObjectLiteralProperty(name_expression, value, | 2650 return factory()->NewObjectLiteralProperty(name_expression, value, |
2651 ObjectLiteralProperty::COMPUTED, | 2651 ObjectLiteralProperty::COMPUTED, |
2652 is_static, *is_computed_name); | 2652 is_static, *is_computed_name); |
2653 | 2653 |
2654 } else if (in_class && name_is_static && !is_static) { | 2654 } else if (in_class && name_is_static && !is_static) { |
2655 // static MethodDefinition | 2655 // static MethodDefinition |
2656 return ParsePropertyDefinition(checker, true, has_extends, true, | 2656 return ParsePropertyDefinition(checker, true, has_extends, true, |
2657 is_computed_name, nullptr, classifier, ok); | 2657 is_computed_name, nullptr, classifier, ok); |
2658 } else if (is_get || is_set) { | 2658 } else if ((is_get || is_set) && |
| 2659 (in_class || (peek() != Token::RBRACE && peek() != Token::COMMA && |
| 2660 peek() != Token::ASSIGN))) { |
2659 // Accessor | 2661 // Accessor |
2660 name = this->EmptyIdentifier(); | 2662 name = this->EmptyIdentifier(); |
2661 bool dont_care = false; | 2663 bool dont_care = false; |
2662 name_token = peek(); | 2664 name_token = peek(); |
2663 | 2665 |
2664 name_expression = ParsePropertyName( | 2666 name_expression = ParsePropertyName( |
2665 &name, &dont_care, &dont_care, &dont_care, is_computed_name, classifier, | 2667 &name, &dont_care, &dont_care, &dont_care, is_computed_name, classifier, |
2666 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); | 2668 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); |
2667 | 2669 |
2668 if (!*is_computed_name) { | 2670 if (!*is_computed_name) { |
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4157 *ok = false; | 4159 *ok = false; |
4158 return; | 4160 return; |
4159 } | 4161 } |
4160 has_seen_constructor_ = true; | 4162 has_seen_constructor_ = true; |
4161 return; | 4163 return; |
4162 } | 4164 } |
4163 } | 4165 } |
4164 } } // v8::internal | 4166 } } // v8::internal |
4165 | 4167 |
4166 #endif // V8_PREPARSER_H | 4168 #endif // V8_PREPARSER_H |
OLD | NEW |