Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/parsing/parser.cc

Issue 2445333002: Ensure slow properties for simple {__proto__:null} literals. (Closed)
Patch Set: fixing typo Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698