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

[wasm] Implement dynamic calling of any JS function #78906

Open
pavelsavara opened this issue Nov 28, 2022 · 3 comments
Open

[wasm] Implement dynamic calling of any JS function #78906

pavelsavara opened this issue Nov 28, 2022 · 3 comments
Assignees
Milestone

Comments

@pavelsavara
Copy link
Member

See #78853 (comment)

  • on JSObject member (probably also bind this)

  • function marshaled as return value

  • will not know the number of parameters nor the types

  • will not know the preferred marshaling configuration
    Therefore it will be much slower than JSImport and it will always make best guess on which marshaler to use for each parameter.

@ghost
Copy link

ghost commented Nov 28, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

See #78853 (comment)

  • on JSObject member (probably also bind this)

  • function marshaled as return value

  • will not know the number of parameters nor the types

  • will not know the preferred marshaling configuration
    Therefore it will be much slower than JSImport and it will always make best guess on which marshaler to use for each parameter.

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, feature-request, area-System.Runtime.InteropServices.JavaScript

Milestone: 8.0.0

@Thaina
Copy link

Thaina commented Nov 28, 2022

Or maybe just return raw unbind function, but reflect the apply bind call from js function's prototype. Then have invoke function to call directly like in js?

@pavelsavara pavelsavara modified the milestones: 8.0.0, 9.0.0 Jul 12, 2023
@pavelsavara pavelsavara added the os-browser Browser variant of arch-wasm label Jan 29, 2024
@tma-lawo
Copy link

tma-lawo commented Apr 5, 2024

This would essentially allow us to skip code generation by using JSHost.GlobalThis to get a function instead of [JSImport("globalThis.whatever")], right?

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

No branches or pull requests

3 participants