diff --git a/boa/src/object/gcobject.rs b/boa/src/object/gcobject.rs index dd5c8191008..9656c21bb8e 100644 --- a/boa/src/object/gcobject.rs +++ b/boa/src/object/gcobject.rs @@ -950,16 +950,23 @@ impl GcObject { // ii. If desc is not undefined and desc.[[Enumerable]] is true, then if let Some(desc) = desc { - if desc.enumerable() { - // 1. Let propValue be ? Get(from, nextKey). - let prop_value = from.__get__(&key, from.clone().into(), context)?; - - // 2. Perform ! CreateDataPropertyOrThrow(target, nextKey, propValue). - self.define_property_or_throw( - key, - DataDescriptor::new(prop_value, Attribute::all()), - context, - ).expect("function CreateDataPropertyOrThrow should never complete abruptly here"); + if let Some(enumerable) = desc.enumerable() { + if enumerable { + // 1. Let propValue be ? Get(from, nextKey). + let prop_value = from.__get__(&key, from.clone().into(), context)?; + + // 2. Perform ! CreateDataPropertyOrThrow(target, nextKey, propValue). + let desc = PropertyDescriptor::builder() + .value(prop_value) + .writable(true) + .enumerable(true) + .configurable(true); + self.define_property_or_throw( + key, + desc, + context, + ).expect("function CreateDataPropertyOrThrow should never complete abruptly here"); + } } } }