-
Notifications
You must be signed in to change notification settings - Fork 694
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
WebAssembly.{compile|instantiate}Streaming: what if embedder doesn't implement it? #1085
Comments
It seems like it'd be much better if the API didn't exist (and wasn't testably present). Maybe nobody wants to implement that though... |
Actually... come to think about it, not terribly hard to implement, at least on the chrome/v8 side. |
Assuming this is how we all go about it, would this need additional specification? |
In my opinion the current spec supports my suggestion, but it could be made clearer by adding a sentence explicitly saying something like "these methods must not exist if they are not supported" or similar. |
Not sure how this is fundamentally different from other properties that are added by other APIs. For example, the DOM adds plenty of properties to the global object. Ecma-262 explicitly allows adding properties. So I agree that (1) is the natural option (and what is currently implied). Also, not returning @domenic, where do you suggest to add this sentence? If it's in the Web API spec, then it won't have any binding consequences, since it wouldn't apply to an embedder that doesn't implement that spec. If it's in the basic JS API spec then it would basically remove the layering. (FWIW, the same question would apply to any of the other suggestions in the OP.) |
@rossberg-chromium for clarity, option 1 was:
I think what we're agreeing on, which wasn't on the original list, and was subsequently proposed by @domenic, is:
and, then, WebAssembly.instantiateStreaming throws ("instantiateStreaming not a function") We're still on the same page, though, correct? (i.e. we want this latter option, not option "1") |
@mtrofin, ah, okay, thanks for the clarification. And yes, I agree with the resolution. |
In Chrome, we're implementing the 2 streaming APIs in v8, on the WebAssembly object (as per spec), and inject the actual implementation from Chrome. This is for layering reasons. I'm assuming we're not alone in taking this approach.
What do we want to do if the embedder "forgets" to inject a dependency? This scenario is unlikely, but may happen in non-web embeddings. A developer porting code to node.js, for example, may hit this situation.
Options:
Personal preference: option 3.
Thoughts?
The text was updated successfully, but these errors were encountered: