From 145aa2b93472d3d613278948be8603a9a3ada8ff Mon Sep 17 00:00:00 2001 From: HalidOdat Date: Tue, 20 Oct 2020 15:27:24 +0200 Subject: [PATCH] Accessors now return undefined --- boa/src/object/internal_methods.rs | 6 ++++-- boa/src/value/mod.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/boa/src/object/internal_methods.rs b/boa/src/object/internal_methods.rs index e30fd2ad88e..eda1e4feb81 100644 --- a/boa/src/object/internal_methods.rs +++ b/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, } } diff --git a/boa/src/value/mod.rs b/boa/src/value/mod.rs index 9daa74fa22c..b5e9832c6ff 100644 --- a/boa/src/value/mod.rs +++ b/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(),