Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback for “Wrap native object” #147

Closed
rain2307 opened this issue Sep 27, 2023 · 0 comments
Closed

Feedback for “Wrap native object” #147

rain2307 opened this issue Sep 27, 2023 · 0 comments

Comments

@rain2307
Copy link

#[js_function(1)]
fn get_native_object(ctx: CallContext) -> Result<JsNumber> {
  let count: i32 = ctx.get::<JsNumber>(0)?.try_into()?;
  let mut this: JsObject = ctx.this_unchecked();
  let native: Native = ctx
    .env
    .unwrap(&mut this)?;
  ctx.env.create_int32(native.value + 1)
}

the count is useless.

This example does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant