| 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/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 3088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3099 if (property == Token::SMI || property == Token::NUMBER) return; | 3099 if (property == Token::SMI || property == Token::NUMBER) return; |
| 3100 | 3100 |
| 3101 if (is_static) { | 3101 if (is_static) { |
| 3102 if (IsPrototype()) { | 3102 if (IsPrototype()) { |
| 3103 this->parser()->ReportMessage("static_prototype"); | 3103 this->parser()->ReportMessage("static_prototype"); |
| 3104 *ok = false; | 3104 *ok = false; |
| 3105 return; | 3105 return; |
| 3106 } | 3106 } |
| 3107 } else if (IsConstructor()) { | 3107 } else if (IsConstructor()) { |
| 3108 if (is_generator || type == kAccessorProperty) { | 3108 if (is_generator || type == kAccessorProperty) { |
| 3109 this->parser()->ReportMessage("constructor_special_method"); | 3109 const char* msg = |
| 3110 is_generator ? "constructor_is_generator" : "constructor_is_accessor"; |
| 3111 this->parser()->ReportMessage(msg); |
| 3110 *ok = false; | 3112 *ok = false; |
| 3111 return; | 3113 return; |
| 3112 } | 3114 } |
| 3113 if (has_seen_constructor_) { | 3115 if (has_seen_constructor_) { |
| 3114 this->parser()->ReportMessage("duplicate_constructor"); | 3116 this->parser()->ReportMessage("duplicate_constructor"); |
| 3115 *ok = false; | 3117 *ok = false; |
| 3116 return; | 3118 return; |
| 3117 } | 3119 } |
| 3118 has_seen_constructor_ = true; | 3120 has_seen_constructor_ = true; |
| 3119 return; | 3121 return; |
| 3120 } | 3122 } |
| 3121 } | 3123 } |
| 3122 } } // v8::internal | 3124 } } // v8::internal |
| 3123 | 3125 |
| 3124 #endif // V8_PREPARSER_H | 3126 #endif // V8_PREPARSER_H |
| OLD | NEW |