-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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 support not easy to find #16952
Comments
Hi, thanks for the issue! Maybe I’m misunderstanding, but All the functions are there: $ node
> process.version
'v9.0.0'
> WebAssembly.compile
[Function: compile] So I guess the real issue here is that |
Yep @addaleax . WebAssembly (formerly wasm) should show its available API, IMHO. Just like i.e. console:
--R |
I think a good solution would be to solve this by taking |
Is this actually incorrect? It matches what all the browsers do... Chrome is the only one that shows the internals but they're faded like private properties are usually. |
@apapirovski I think not displaying the methods is correct, yes. But I think there really should be output that distinguishes |
@addaleax but it matches browser consoles and that's generally been at least partially our goal. |
I feel it as a lack of interactive documentation. |
@apapirovski I think the goal of |
WebAssembly examples online still use wasm and instantiateModule. --R |
@RobertoMalatesta To be clear, what I’m suggesting is to switch to something like The methods are all there, it’s really just a question of how to display the object in question. |
Fine for me if there's an easy way to follow its API development (not only for me but for anyone interested). Thanks for your work, (just trying to be of help). --Roberto |
I'm still not convinced we should be doing anything differently.
https://github.com/WebAssembly/design/blob/master/JS.md It's a plain JS object with non-enumerable properties. It's not a class, constructor, whatever. Naming it as |
|
@apapirovski ok. no matter where you can put those infos, but either they're secret or they have to be documented. Math and JSON are waay documented :P. |
@RobertoMalatesta But Node isn't even the source of WebAssembly, V8 is and it's part of the JS documentation out there. It doesn't make sense for Node to document WebAssembly. |
We don't document Math and JSON... others do and they do the same for WebAssembly. |
@apapirovski Right, I would really like it for |
@addaleax Fair enough. 👍 |
Is there a performance reason not doing that? |
It's about conformance to the spec. The properties are not enumerable and are not meant to be shown. The proposal by @addaleax is to have it show |
|
Yes, the version of wasm in V8 in that release had enumerable properties. If you have a problem with this behaviour then take it up with the spec writers or V8. Node is not the issue here. |
OK. Thanks for your help, and time on nodejs |
I'm keeping this open as we still want to implement the |
@devsnek Yea, I’m not super happy about displaying |
I mean, that's what |
i think we're all in agreement at this point. 👀 |
Well, I think there's a merit here to saying that |
+1 to using showHidden in REPL |
@apapirovski i'm not so sure about this behavior, my only thought is to apply separate depth limits to enumerable and non-enumerable properties on util.inspect |
-1 The name before the braces should be a class/constructor name, not a namespace, for consistency. |
@mscdex It's not a name space, but the |
@joyeecheung In these cases, the |
@mscdex But this does not have to be about those built-in obejects. Considering this: var foo = {};
Object.defineProperty(foo, Symbol.toStringTag, { value: 'Foo', enumerable: false }) IMO in this case it's reasonable to display foo as |
@joyeecheung Using the same notation as constructor names is misleading and inconsistent. |
@joyeecheung @mscdex It would be nice if you could chime in at what’s being discussed in #16956 (comment) as a solution |
#16956 landed. Closing. |
Thanks for your time,
--Rob
The text was updated successfully, but these errors were encountered: