[wasm][bindings] Refactor WebAssembly.Core object instantiation. (#14191)
commit5d9ecd7112bd877df234ca7edac35de02b8c27c8
authorKenneth Pouncey <kjpou@pt.lu>
Sat, 27 Apr 2019 07:27:22 +0000 (27 09:27 +0200)
committerGitHub <noreply@github.com>
Sat, 27 Apr 2019 07:27:22 +0000 (27 09:27 +0200)
tree6d804326b38cbffa44b597966da8da788b1cb8d1
parent87000b43bbbdeca817f98030c64eecc65ec68ee5
[wasm][bindings] Refactor WebAssembly.Core object instantiation. (#14191)

* Refactor WebAssembly.Core object instantiation.

- Move the supported Core object identification into javascript.
- Runtime the core object type is now passed into the Runtime from javascript binding support instead of being housed in managed code.

* Address review comments.

* Fix indentation

* Implement suggestion by Katelyn Gadd to use Symbol instead of a Map or WeakMap.

- This removes the previous mono_wasm_core_map used for type mapping.
- Attach a special named symbol for `wasm type` to the prototype property for the Core objects that we have bound.
- The Managed Type is stored in the symbol property that will be passed to the managed side.
sdks/wasm/binding_support.js
sdks/wasm/framework/src/WebAssembly.Bindings/Runtime.cs