summaryrefslogtreecommitdiff
path: root/index.htm
diff options
context:
space:
mode:
Diffstat (limited to 'index.htm')
-rw-r--r--index.htm23
1 files changed, 17 insertions, 6 deletions
diff --git a/index.htm b/index.htm
index 170acef..8b81874 100644
--- a/index.htm
+++ b/index.htm
@@ -46,11 +46,22 @@
fd_seek : () => { throw new Error("Unexpected fd_seek call"); },
},
env : {
- log_error_impl : (file_len, file, line, func_len, func, text_len, text) => {
- let s_file = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, file, file_len));
- let s_func = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, func, func_len));
- let s_text = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, text, text_len));
- console.error(`${s_file}:${line}, ${s_func}: ${s_text}`);
+ log_impl : (mode, file_len, file, line, func_len, func, text_len, text) => {
+ if (text_len == 0) {
+ let s_file = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, file, file_len));
+ let s_func = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, func, func_len));
+
+ console.log(`${s_file}:${line}, ${s_func}`);
+ } else {
+ let s_file = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, file, file_len));
+ let s_func = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, func, func_len));
+ let s_text = String.fromCharCode.apply(null, new Uint8Array(this.memory_buffer, text, text_len));
+
+ if (mode == 0)
+ console.log(`${s_file}:${line}, ${s_func}: ${s_text}`);
+ else
+ console.error(`${s_file}:${line}, ${s_func}: ${s_text}`);
+ }
},
write_clipboard_text_impl : (size, text) => {
let text_buffer = new ArrayBuffer(size);
@@ -290,7 +301,7 @@
wasm,
{
env : {
- log_error_impl : () => {},
+ log_impl : () => {},
write_clipboard_impl : () => {},
current_utc_time_in_milliseconds : () => {},