Skip to content

Commit

Permalink
Updating unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pauan committed Apr 21, 2020
1 parent 8451107 commit 13f5c29
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
23 changes: 13 additions & 10 deletions crates/cli/tests/reference/anyref-import-catch.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,26 @@ function addToAnyrefTable0(obj) {
return idx;
}

function handleError(e) {
const idx = addToAnyrefTable0(e);
wasm.__wbindgen_exn_store(idx);
function handleError(f) {
return function () {
try {
return f.apply(this, arguments);

} catch (e) {
const idx = addToAnyrefTable0(e);
wasm.__wbindgen_exn_store(idx);
}
};
}
/**
*/
export function exported() {
wasm.exported();
}

export const __wbg_foo_8d66ddef0ff279d6 = function() {
try {
foo();
} catch (e) {
handleError(e)
}
};
export const __wbg_foo_8d66ddef0ff279d6 = handleError(function() {
foo();
});

export const __wbindgen_throw = function(arg0, arg1) {
throw new Error(getStringFromWasm0(arg0, arg1));
Expand Down
23 changes: 13 additions & 10 deletions crates/cli/tests/reference/import-catch.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,30 @@ function addHeapObject(obj) {
return idx;
}

function handleError(e) {
wasm.__wbindgen_exn_store(addHeapObject(e));
function handleError(f) {
return function () {
try {
return f.apply(this, arguments);

} catch (e) {
wasm.__wbindgen_exn_store(addHeapObject(e));
}
};
}
/**
*/
export function exported() {
wasm.exported();
}

export const __wbg_foo_8d66ddef0ff279d6 = handleError(function() {
foo();
});

export const __wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
};

export const __wbg_foo_8d66ddef0ff279d6 = function() {
try {
foo();
} catch (e) {
handleError(e)
}
};

export const __wbindgen_rethrow = function(arg0) {
throw takeObject(arg0);
};
Expand Down

0 comments on commit 13f5c29

Please sign in to comment.