mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 17:51:33 +00:00
Use splat instead of arguments
in tests
Previously `arguments` was used to pass around an array of arguments, but this wasn't actually a `js_sys::Array` but rather a somewhat esoteric internal object. When switching over `Array` methods to be `structural` this caused issues because the inherent methods on an `arguments` object were different than that of `js_sys::Array`.
This commit is contained in:
@ -19,17 +19,17 @@
|
||||
logs.innerHTML += `${msg}\n`;
|
||||
}
|
||||
};
|
||||
console.log = function() {
|
||||
console.log = function(...args) {
|
||||
if (window.console_log_redirect)
|
||||
window.console_log_redirect(orig_console_log, arguments);
|
||||
window.console_log_redirect(orig_console_log, args);
|
||||
else
|
||||
orig_console_log.apply(this, arguments);
|
||||
orig_console_log.apply(this, args);
|
||||
};
|
||||
console.error = function() {
|
||||
console.error = function(...args) {
|
||||
if (window.console_error_redirect)
|
||||
window.console_error_redirect(orig_console_error, arguments);
|
||||
window.console_error_redirect(orig_console_error, args);
|
||||
else
|
||||
orig_console_error.apply(this, arguments);
|
||||
orig_console_error.apply(this, args);
|
||||
};
|
||||
window.__wbg_test_invoke = f => f();
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user