| 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 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
| (...skipping 4224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4235 void Parser::SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, | 4235 void Parser::SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, |
| 4236 const AstRawString* name) { | 4236 const AstRawString* name) { |
| 4237 DCHECK(property->kind() != ObjectLiteralProperty::GETTER); | 4237 DCHECK(property->kind() != ObjectLiteralProperty::GETTER); |
| 4238 DCHECK(property->kind() != ObjectLiteralProperty::SETTER); | 4238 DCHECK(property->kind() != ObjectLiteralProperty::SETTER); |
| 4239 | 4239 |
| 4240 // Computed name setting must happen at runtime. | 4240 // Computed name setting must happen at runtime. |
| 4241 DCHECK(!property->is_computed_name()); | 4241 DCHECK(!property->is_computed_name()); |
| 4242 | 4242 |
| 4243 // Ignore "__proto__" as a name when it's being used to set the [[Prototype]] | 4243 // Ignore "__proto__" as a name when it's being used to set the [[Prototype]] |
| 4244 // of an object literal. | 4244 // of an object literal. |
| 4245 if (property->kind() == ObjectLiteralProperty::PROTOTYPE) return; | 4245 if (property->IsPrototype()) return; |
| 4246 | 4246 |
| 4247 Expression* value = property->value(); | 4247 Expression* value = property->value(); |
| 4248 | 4248 |
| 4249 DCHECK(!value->IsAnonymousFunctionDefinition() || | 4249 DCHECK(!value->IsAnonymousFunctionDefinition() || |
| 4250 property->kind() == ObjectLiteralProperty::COMPUTED); | 4250 property->kind() == ObjectLiteralProperty::COMPUTED); |
| 4251 SetFunctionName(value, name); | 4251 SetFunctionName(value, name); |
| 4252 } | 4252 } |
| 4253 | 4253 |
| 4254 void Parser::SetFunctionNameFromIdentifierRef(Expression* value, | 4254 void Parser::SetFunctionNameFromIdentifierRef(Expression* value, |
| 4255 Expression* identifier) { | 4255 Expression* identifier) { |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5197 | 5197 |
| 5198 return final_loop; | 5198 return final_loop; |
| 5199 } | 5199 } |
| 5200 | 5200 |
| 5201 #undef CHECK_OK | 5201 #undef CHECK_OK |
| 5202 #undef CHECK_OK_VOID | 5202 #undef CHECK_OK_VOID |
| 5203 #undef CHECK_FAILED | 5203 #undef CHECK_FAILED |
| 5204 | 5204 |
| 5205 } // namespace internal | 5205 } // namespace internal |
| 5206 } // namespace v8 | 5206 } // namespace v8 |
| OLD | NEW |