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 4119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4130 void Parser::SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, | 4130 void Parser::SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, |
4131 const AstRawString* name) { | 4131 const AstRawString* name) { |
4132 DCHECK(property->kind() != ObjectLiteralProperty::GETTER); | 4132 DCHECK(property->kind() != ObjectLiteralProperty::GETTER); |
4133 DCHECK(property->kind() != ObjectLiteralProperty::SETTER); | 4133 DCHECK(property->kind() != ObjectLiteralProperty::SETTER); |
4134 | 4134 |
4135 // Computed name setting must happen at runtime. | 4135 // Computed name setting must happen at runtime. |
4136 DCHECK(!property->is_computed_name()); | 4136 DCHECK(!property->is_computed_name()); |
4137 | 4137 |
4138 // Ignore "__proto__" as a name when it's being used to set the [[Prototype]] | 4138 // Ignore "__proto__" as a name when it's being used to set the [[Prototype]] |
4139 // of an object literal. | 4139 // of an object literal. |
4140 if (property->kind() == ObjectLiteralProperty::PROTOTYPE) return; | 4140 if (property->IsPrototype()) return; |
4141 | 4141 |
4142 Expression* value = property->value(); | 4142 Expression* value = property->value(); |
4143 | 4143 |
4144 DCHECK(!value->IsAnonymousFunctionDefinition() || | 4144 DCHECK(!value->IsAnonymousFunctionDefinition() || |
4145 property->kind() == ObjectLiteralProperty::COMPUTED); | 4145 property->kind() == ObjectLiteralProperty::COMPUTED); |
4146 SetFunctionName(value, name); | 4146 SetFunctionName(value, name); |
4147 } | 4147 } |
4148 | 4148 |
4149 void Parser::SetFunctionNameFromIdentifierRef(Expression* value, | 4149 void Parser::SetFunctionNameFromIdentifierRef(Expression* value, |
4150 Expression* identifier) { | 4150 Expression* identifier) { |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5067 | 5067 |
5068 return final_loop; | 5068 return final_loop; |
5069 } | 5069 } |
5070 | 5070 |
5071 #undef CHECK_OK | 5071 #undef CHECK_OK |
5072 #undef CHECK_OK_VOID | 5072 #undef CHECK_OK_VOID |
5073 #undef CHECK_FAILED | 5073 #undef CHECK_FAILED |
5074 | 5074 |
5075 } // namespace internal | 5075 } // namespace internal |
5076 } // namespace v8 | 5076 } // namespace v8 |
OLD | NEW |