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 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2187 | 2187 |
2188 if (!*is_computed_name) { | 2188 if (!*is_computed_name) { |
2189 checker->CheckProperty(name_token, kAccessorProperty, is_static, | 2189 checker->CheckProperty(name_token, kAccessorProperty, is_static, |
2190 is_generator, | 2190 is_generator, |
2191 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); | 2191 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); |
2192 } | 2192 } |
2193 | 2193 |
2194 typename Traits::Type::FunctionLiteral value = this->ParseFunctionLiteral( | 2194 typename Traits::Type::FunctionLiteral value = this->ParseFunctionLiteral( |
2195 name, scanner()->location(), | 2195 name, scanner()->location(), |
2196 false, // reserved words are allowed here | 2196 false, // reserved words are allowed here |
2197 FunctionKind::kNormalFunction, RelocInfo::kNoPosition, | 2197 FunctionKind::kAccessorFunction, RelocInfo::kNoPosition, |
2198 FunctionLiteral::ANONYMOUS_EXPRESSION, | 2198 FunctionLiteral::ANONYMOUS_EXPRESSION, |
2199 is_get ? FunctionLiteral::GETTER_ARITY : FunctionLiteral::SETTER_ARITY, | 2199 is_get ? FunctionLiteral::GETTER_ARITY : FunctionLiteral::SETTER_ARITY, |
2200 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); | 2200 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); |
2201 | 2201 |
2202 // Make sure the name expression is a string since we need a Name for | 2202 // Make sure the name expression is a string since we need a Name for |
2203 // Runtime_DefineAccessorPropertyUnchecked and since we can determine this | 2203 // Runtime_DefineAccessorPropertyUnchecked and since we can determine this |
2204 // statically we can skip the extra runtime check. | 2204 // statically we can skip the extra runtime check. |
2205 if (!*is_computed_name) { | 2205 if (!*is_computed_name) { |
2206 name_expression = | 2206 name_expression = |
2207 factory()->NewStringLiteral(name, name_expression->position()); | 2207 factory()->NewStringLiteral(name, name_expression->position()); |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 *ok = false; | 3097 *ok = false; |
3098 return; | 3098 return; |
3099 } | 3099 } |
3100 has_seen_constructor_ = true; | 3100 has_seen_constructor_ = true; |
3101 return; | 3101 return; |
3102 } | 3102 } |
3103 } | 3103 } |
3104 } } // v8::internal | 3104 } } // v8::internal |
3105 | 3105 |
3106 #endif // V8_PREPARSER_H | 3106 #endif // V8_PREPARSER_H |
OLD | NEW |