-
Notifications
You must be signed in to change notification settings - Fork 40
Rename anyfunc to funcref in js-api tests #85
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, removing anyfunc
entirely from the JS API would be a breaking change. I think we need to keep supporting it in the Table constructor for backwards compatibility.
Agreed, this is not workable. We could add an alias "funcref" → "anyfunc", though that doesn't seem all that valuable. (Not entirely serious alternative: rename "externref" to "anyextern"?) |
Aliasing seems fine. We could restrict use of the old name to the Table constructor, just like we do for the "initial" limit in the JS Types proposal. |
I guess this alias would be rather less complex than the one in JS Types. It looks like we don't expose the value to JS yet, either. If we want to make "funcref" the canonical value, we'll also need to make sure JS Types returns it from the type function. |
FWIW, through an oversight Firefox has been accepting 'funcref' exclusively for the last two years, while Chrome has been accepting 'anyfunc' for at least the last three years, judging from git blame. I have received zero bug reports about the incompatibility until Asumu just pointed me to a bug about WPT adding some tests for this (web-platform-tests/wpt@0286e80#diff-631970eae3abaebb8e90fc901c0725f3eea12e792f2c83b45b2b96b647a56dcb) Since Chrome accepts anyfunc only I will fix this in Firefox, but I think the compat concerns are probably a little overblow. (Of course there could be workarounds for the discrepancy out there, but again, I've received no bug reports.) |
@lars-t-hansen, interesting. I would of course be happy to retire |
Accepting |
Well, post in haste, edit at leisure :-/ It turns out that we had a special workaround for parsing the table descriptor, which in addition to Sorry for the noise. (I still think accepting funcref as an alias for anyfunc in the JS API is a good idea.) |
@gahaas, how about you revive this PR, and change it to aliasing the name? For process reasons, could be made part of the JS type reflection proposal. |
Sure, I will look into this. |
The string
anyfunc
still occurred in js-api tests. This PR replaces all these occurrences byfuncref
.