mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibJS/Bytecode: Always make own properties in object expressions
When building an object from an object expression, we don't want to go through the full property setting machinery. This patch adds a new PropertyKind::DirectKeyValue for PutById which guarantees that the property becomes an own property. This fixes an issue where setting the "__proto__" property in object expressions wasn't working right. 12 new passes on test262. :^)
This commit is contained in:
committed by
Linus Groh
parent
91528e94ac
commit
e0b2757f95
@@ -76,6 +76,9 @@ static ThrowCompletionOr<void> put_by_property_key(VM& vm, Value base, Value thi
|
||||
return vm.throw_completion<TypeError>(ErrorType::ReferenceNullishSetProperty, name, TRY_OR_THROW_OOM(vm, base.to_string_without_side_effects()));
|
||||
break;
|
||||
}
|
||||
case PropertyKind::DirectKeyValue:
|
||||
object->define_direct_property(name, value, Attribute::Enumerable | Attribute::Writable | Attribute::Configurable);
|
||||
break;
|
||||
case PropertyKind::Spread:
|
||||
TRY(object->copy_data_properties(vm, value, {}));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user