Skip to content

Commit

Permalink
Remove JsValue::get_field()
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Mar 2, 2022
1 parent 69e4958 commit 5cc4190
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
17 changes: 0 additions & 17 deletions boa_engine/src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,23 +322,6 @@ impl JsValue {
}
}

/**
Resolve the property in the object and get its value, or undefined if this is not an object or the field doesn't exist
`get_field` receives a Property from get_prop(). It should then return the `[[Get]]` result value if that's set, otherwise fall back to `[[Value]]`
*/
pub(crate) fn get_field<K>(&self, key: K, context: &mut Context) -> JsResult<Self>
where
K: Into<PropertyKey>,
{
let _timer = Profiler::global().start_event("Value::get_field", "value");
if let Self::Object(ref obj) = *self {
obj.clone()
.__get__(&key.into(), obj.clone().into(), context)
} else {
Ok(Self::undefined())
}
}

/// Set the kind of an object.
#[inline]
pub fn set_data(&self, data: ObjectData) {
Expand Down
3 changes: 1 addition & 2 deletions boa_engine/src/vm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,8 @@ impl Context {
self.vm.push(iterator);
self.vm.push(next_function);
if let Some(next) = next {
let done = next.complete(self)?;
let value = next.value(self)?;
self.vm.push(done);
self.vm.push(false);
self.vm.push(value);
} else {
self.vm.push(true);
Expand Down

0 comments on commit 5cc4190

Please sign in to comment.