Skip to content

Commit

Permalink
Fix errors after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad committed Aug 8, 2021
1 parent f800db8 commit 7cf86fa
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions boa/src/object/gcobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
}
Expand Down

0 comments on commit 7cf86fa

Please sign in to comment.