Browse Source

Fix Accessors panics (#902)

pull/903/head
Halid Odat 4 years ago committed by GitHub
parent
commit
f3a293b50b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      boa/src/object/internal_methods.rs
  2. 3
      boa/src/value/mod.rs

6
boa/src/object/internal_methods.rs

@ -83,8 +83,9 @@ impl GcObject {
parent.get_field(key.clone())
}
Some(ref desc) => match desc {
PropertyDescriptor::Accessor(_) => todo!(),
PropertyDescriptor::Data(desc) => desc.value(),
// TODO: Add accessors
PropertyDescriptor::Accessor(_) => Value::undefined(),
},
}
}
@ -118,7 +119,8 @@ impl GcObject {
let desc = DataDescriptor::new(val, own_desc.attributes()).into();
self.define_own_property(key, desc)
}
PropertyDescriptor::Accessor(_) => todo!(),
// TODO: Add accessors
PropertyDescriptor::Accessor(_) => false,
}
}

3
boa/src/value/mod.rs

@ -456,7 +456,8 @@ impl Value {
let key = key.into();
match self.get_property(key) {
Some(ref desc) => match desc {
PropertyDescriptor::Accessor(_) => todo!("property accessor descriptors"),
// TODO: Add accessors
PropertyDescriptor::Accessor(_) => Value::undefined(),
PropertyDescriptor::Data(desc) => desc.value(),
},
None => Value::undefined(),

Loading…
Cancel
Save