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

JsFunction bind not a function #134

Open
lastmjs opened this issue Jan 29, 2024 · 0 comments
Open

JsFunction bind not a function #134

lastmjs opened this issue Jan 29, 2024 · 0 comments

Comments

@lastmjs
Copy link

lastmjs commented Jan 29, 2024

Here's some example code:

  let bound_function = exports_js_object
      .get(&export_name)
      .to_function()
      .unwrap()
      .get("bind")
      .to_function()
      .unwrap()
      .call(&[JsValue::Int(4).into()]);

This code executes just fine as in the unwraps do not panic, but bound_function is an exception and when I dump the error it essentially says this: TypeError: not a function at bind (native).

I am trying to pass some dynamic data into a function created dynamically in Rust, and it seems the only way I can really do this is through the this_val, thus I am trying to set it. A closure will not work because of a wasmwedge-quickjs assertion that seems to panic whenever the JsFunction closure captures any of its environment.

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