-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
web-sys's API around Window seems to be wrong #834
Comments
And it seems to me that to reasonably implement |
Gah -- we hadn't considered multiple +cc @alexcrichton |
Makes sense to me, I'll work on reverting #761 |
alexcrichton
added a commit
to alexcrichton/wasm-bindgen
that referenced
this issue
Sep 17, 2018
This is intended to address rustwasm#834 where we don't actually want methods scoped like this! Instead we'll provide one unique accessor for the `window` object itself.
alexcrichton
added a commit
to alexcrichton/wasm-bindgen
that referenced
this issue
Sep 18, 2018
This is intended to address rustwasm#834 where we don't actually want methods scoped like this! Instead we'll provide one unique accessor for the `window` object itself.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, web-sys provides a Window type and use static functions to access objects and functions in the current global.
This seems to be conceptually wrong. Window is an object, and there can be multiple independent Window around, so the current global is just one Window object.
I suggest it provide a top level function
window()
which returns aOption<Window>
instead (Option
because the code may run in worker / worklet global wherewindow
isn't available).The text was updated successfully, but these errors were encountered: