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 4100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4111 void Parser::SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, | 4111 void Parser::SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, |
4112 const AstRawString* name) { | 4112 const AstRawString* name) { |
4113 DCHECK(property->kind() != ObjectLiteralProperty::GETTER); | 4113 DCHECK(property->kind() != ObjectLiteralProperty::GETTER); |
4114 DCHECK(property->kind() != ObjectLiteralProperty::SETTER); | 4114 DCHECK(property->kind() != ObjectLiteralProperty::SETTER); |
4115 | 4115 |
4116 // Computed name setting must happen at runtime. | 4116 // Computed name setting must happen at runtime. |
4117 DCHECK(!property->is_computed_name()); | 4117 DCHECK(!property->is_computed_name()); |
4118 | 4118 |
4119 // Ignore "__proto__" as a name when it's being used to set the [[Prototype]] | 4119 // Ignore "__proto__" as a name when it's being used to set the [[Prototype]] |
4120 // of an object literal. | 4120 // of an object literal. |
4121 if (property->kind() == ObjectLiteralProperty::PROTOTYPE) return; | 4121 if (property->IsPrototype()) return; |
4122 | 4122 |
4123 Expression* value = property->value(); | 4123 Expression* value = property->value(); |
4124 | 4124 |
4125 DCHECK(!value->IsAnonymousFunctionDefinition() || | 4125 DCHECK(!value->IsAnonymousFunctionDefinition() || |
4126 property->kind() == ObjectLiteralProperty::COMPUTED); | 4126 property->kind() == ObjectLiteralProperty::COMPUTED); |
4127 SetFunctionName(value, name); | 4127 SetFunctionName(value, name); |
4128 } | 4128 } |
4129 | 4129 |
4130 void Parser::SetFunctionNameFromIdentifierRef(Expression* value, | 4130 void Parser::SetFunctionNameFromIdentifierRef(Expression* value, |
4131 Expression* identifier) { | 4131 Expression* identifier) { |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5048 | 5048 |
5049 return final_loop; | 5049 return final_loop; |
5050 } | 5050 } |
5051 | 5051 |
5052 #undef CHECK_OK | 5052 #undef CHECK_OK |
5053 #undef CHECK_OK_VOID | 5053 #undef CHECK_OK_VOID |
5054 #undef CHECK_FAILED | 5054 #undef CHECK_FAILED |
5055 | 5055 |
5056 } // namespace internal | 5056 } // namespace internal |
5057 } // namespace v8 | 5057 } // namespace v8 |
OLD | NEW |