Skip to content

Commit

Permalink
Fix broken JS
Browse files Browse the repository at this point in the history
  • Loading branch information
SevInf committed Dec 4, 2023
1 parent 0bc5b6c commit 2a2565a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion query-engine/driver-adapters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ pub(crate) use wasm::*;

#[cfg(target_arch = "wasm32")]
mod arch {
use std::str::FromStr;

pub(crate) use super::JsObject;
pub(crate) use js_sys::JsString;
use js_sys::Reflect;
use tsify::Tsify;
use wasm_bindgen::JsValue;

Expand All @@ -51,7 +54,7 @@ mod arch {
}

pub(crate) fn has_named_property(object: &JsObject, name: &str) -> JsResult<bool> {
Ok(JsObject::has_own(object, name.into()))
Ok(Reflect::has(&object, &JsString::from_str(name).unwrap().into())?)
}

pub(crate) fn to_rust_str(value: JsString) -> JsResult<String> {
Expand Down
3 changes: 0 additions & 3 deletions query-engine/driver-adapters/src/wasm/js_object_extern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ extern "C" {

#[wasm_bindgen(method, catch, structural, indexing_getter)]
pub fn get(this: &JsObjectExtern, key: JsString) -> Result<JsValue, JsValue>;

#[wasm_bindgen(static_method_of = JsObjectExtern, js_name = hasOwn)]
pub fn has_own(this: &JsObjectExtern, key: JsString) -> bool;
}

0 comments on commit 2a2565a

Please sign in to comment.