Implement support for js_class on exported types

Allow defining types which have different names in Rust than they have
in JS! (just like can be done with imported types)

Closes #1010
This commit is contained in:
Alex Crichton
2018-11-05 12:29:14 -08:00
parent 3c31a32d51
commit 16d5243362
8 changed files with 142 additions and 31 deletions

View File

@ -136,3 +136,10 @@ exports.js_js_rename = () => {
exports.js_access_fields = () => {
assert.ok((new wasm.AccessFieldFoo()).bar instanceof wasm.AccessFieldBar);
};
exports.js_renamed_export = () => {
const x = new wasm.JsRenamedExport();
assert.ok(x.x === 3);
x.foo();
x.bar(x);
};