mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-24 18:43:33 +03:00
wasm-bindgen-test: Use spread array arguments instead of arguments objects
Our testing runtime tries to call `Array.prototype.forEach` on this object, so it had damn well better be a proper array! Fixes #1167
This commit is contained in:
parent
666c1e4584
commit
51ef19b85f
@ -7,17 +7,17 @@
|
||||
<script>
|
||||
const orig_console_log = console.log;
|
||||
const orig_console_error = console.error;
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user