Skip to content

Commit

Permalink
Fix remaining property tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Jul 27, 2021
1 parent ca416b4 commit 30471fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion boa/src/builtins/bigint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl BuiltIn for BigInt {
.value(bigint_object)
.writable(true)
.enumerable(false)
.configurable(false)
.configurable(true)
.build(),
)
}
Expand Down
23 changes: 13 additions & 10 deletions boa/src/object/internal_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl GcObject {
DescriptorKind::Data {
value: Some(value), ..
} => Ok(value.clone()),
DescriptorKind::Accessor { get: Some(get), .. } => {
DescriptorKind::Accessor { get: Some(get), .. } if !get.is_undefined() => {
context.call(get, &receiver, &[])
}
_ => Ok(Value::undefined()),
Expand Down Expand Up @@ -351,19 +351,22 @@ impl GcObject {
if !existing_desc.expect_writable() {
return Ok(false);
}
receiver.__define_own_property__(
return receiver.__define_own_property__(
key,
PropertyDescriptor::builder().value(value).build(),
context,
)
);
} else {
receiver.create_data_property(key, value, context)
return receiver.create_data_property(key, value, context);
}
} else if let Some(set) = own_desc.set() {
context.call(set, &receiver, &[value])?;
Ok(true)
} else {
Ok(false)
}

match own_desc.set() {
Some(set) if !set.is_undefined() => {
context.call(set, &receiver, &[value])?;
Ok(true)
}
_ => Ok(false),
}
}

Expand Down Expand Up @@ -702,7 +705,7 @@ impl GcObject {
}

for (p, d) in descriptors {
self.__define_own_property__(p, d, context)?;
self.define_property_or_throw(p, d, context)?;
}

Ok(())
Expand Down

0 comments on commit 30471fc

Please sign in to comment.