Skip to content

Commit

Permalink
fix paths in derive macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-str committed Sep 19, 2024
1 parent d7d1e64 commit 21b57de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions core/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ pub fn derive_try_into_js(input: TokenStream) -> TokenStream {
let expanded = quote! {
impl ::boa_engine::value::TryIntoJs for #type_name {
fn try_into_js(&self, context: &mut boa_engine::Context) -> boa_engine::JsResult<boa_engine::JsValue> {
let obj = JsObject::default();
let obj = boa_engine::JsObject::default();
#props
JsResult::Ok(obj.into())
boa_engine::JsResult::Ok(obj.into())
}
}
};
Expand Down Expand Up @@ -595,10 +595,10 @@ fn generate_obj_properties(fields: FieldsNamed) -> Result<proc_macro2::TokenStre
let into_js_with = Ident::new(&into_js_with.value(), into_js_with.span());
quote! { #into_js_with(&self.#name, context)? }
} else {
quote! { self.#name.try_into_js(context)? }
quote! { boa_engine::value::TryIntoJs::try_into_js(&self.#name, context)? }
};
prop_ctors.push(quote! {
obj.create_data_property_or_throw(js_str!(#prop_key), #value, context)?;
obj.create_data_property_or_throw(boa_engine::js_str!(#prop_key), #value, context)?;
});
}

Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/try_into_js_derive.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use boa_engine::{
js_str, js_string,
js_string,
value::{TryFromJs, TryIntoJs},
Context, JsObject, JsResult, JsValue, Source,
Context, JsResult, JsValue, Source,
};

#[derive(TryIntoJs)]
Expand Down

0 comments on commit 21b57de

Please sign in to comment.