mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-09 02:51:21 +00:00
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`.
39 lines
1.2 KiB
HTML
39 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
|
|
</head>
|
|
<body>
|
|
<pre id='output'>Loading scripts...</pre>
|
|
<pre id='console_log'></pre>
|
|
<pre id='console_error'></pre>
|
|
<script>
|
|
const orig_console_log = function(...args) {
|
|
const logs = document.getElementById('console_log');
|
|
for (let msg of args) {
|
|
logs.innerHTML += `${msg}\n`;
|
|
}
|
|
};
|
|
const orig_console_error = function(...args) {
|
|
const logs = document.getElementById('console_error');
|
|
for (let msg of args) {
|
|
logs.innerHTML += `${msg}\n`;
|
|
}
|
|
};
|
|
console.log = function(...args) {
|
|
if (window.console_log_redirect)
|
|
window.console_log_redirect(orig_console_log, args);
|
|
else
|
|
orig_console_log.apply(this, args);
|
|
};
|
|
console.error = function(...args) {
|
|
if (window.console_error_redirect)
|
|
window.console_error_redirect(orig_console_error, args);
|
|
else
|
|
orig_console_error.apply(this, args);
|
|
};
|
|
window.__wbg_test_invoke = f => f();
|
|
</script>
|
|
<script src='run.js' type=module></script>
|
|
</body>
|
|
</html>
|