[class] Remove unncessary check for private field
A computed property can never be a private field. That's a SyntaxError. Change the check to a DCHECK. Bug: v8:5368 Change-Id: I6701b60f3193639f3ccffacda25074d32d5de5b8 Reviewed-on: https://chromium-review.googlesource.com/c/1385267 Reviewed-by: Mythri Alle <mythria@chromium.org> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#58451}
This commit is contained in:
parent
f88d169e51
commit
646051f901
@ -1866,8 +1866,6 @@ void BytecodeGenerator::BuildClassLiteral(ClassLiteral* expr, Register name) {
|
||||
for (int i = 0; i < expr->properties()->length(); i++) {
|
||||
ClassLiteral::Property* property = expr->properties()->at(i);
|
||||
if (property->is_computed_name()) {
|
||||
DCHECK_IMPLIES(property->kind() == ClassLiteral::Property::FIELD,
|
||||
!property->is_private());
|
||||
Register key = register_allocator()->GrowRegisterList(&args);
|
||||
|
||||
builder()->SetExpressionAsStatementPosition(property->key());
|
||||
@ -1889,8 +1887,8 @@ void BytecodeGenerator::BuildClassLiteral(ClassLiteral* expr, Register name) {
|
||||
.Bind(&done);
|
||||
}
|
||||
|
||||
if (property->kind() == ClassLiteral::Property::FIELD &&
|
||||
!property->is_private()) {
|
||||
if (property->kind() == ClassLiteral::Property::FIELD) {
|
||||
DCHECK(!property->is_private());
|
||||
// Initialize field's name variable with the computed name.
|
||||
DCHECK_NOT_NULL(property->computed_name_var());
|
||||
builder()->LoadAccumulatorWithRegister(key);
|
||||
|
Loading…
Reference in New Issue
Block a user