-
Notifications
You must be signed in to change notification settings - Fork 695
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
Export JSFunctions should have string names #883
Comments
In particular, the SetFunctionName meta function explicitly makes this assumption. A ToString conversion seems in order. |
Yeah, I don't know what I was thinking when I wrote that because we assign a string too. Actually, looking at the code, we don't assign the stringified index, we write the same function name we use in callstacks which will use the name provided by the names section. I guess that's a bad idea, since it means stripping the names section could break code (which is technically true b/c |
We were doing something slightly different: using the name of the first export of that function. I think Stringified function index makes the most sense here. |
Oh, that's a neat idea, and stable under name-stripping. Technically there is the corner case of exported functions derived from I guess a question is whether |
Some implementations include the name when invoking toString on the function, though nothing around that is properly standardised, and it's already violated by some other cases. There are some concrete TC39 proposals on the way that do that, too, though IIRC. |
Oh hah. Just because of how the usual hooks work out, we currently print out So noone's printing the binary->text in So if we're not printing wasm text format in |
Or even |
I just noticed that in JS.md, we specify that the exported Function exotic objects, we specify the name of a function to be the index as a number. That seems to be at odds with ECMAScript, which seems to require that all function names be either a string or a symbol.
Should we change JS.md to specific the function index is stored as a string?
The text was updated successfully, but these errors were encountered: