According to the WebAssembly JS API specification, if a WebAssembly function is imported and then exported again, the same function object should be exported. This property doesn't seem to hold when I run the test [1] against JSC for host functions--although the function is supposed to be wrapped as a WebAssembly function once, if it is then imported and exported a second time, the same function value should result. [1] https://github.com/WebAssembly/spec/pull/644
This is the same as discussed here: https://github.com/WebAssembly/design/issues/920 ? So it's a spec change?
No, there's no spec change here. This link is just provided to show the tests; the spec is not changing with respect to this property. See the logic in [1] and [2]. SpiderMonkey passes these tests. [1] https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyinstance-constructor in the logic with the `funcs` list. [2] https://webassembly.github.io/spec/js-api/index.html#a-new-exported-function step 2