diff options
author | Leon Krause <lk@leonkrause.com> | 2018-01-06 15:53:04 +0100 |
---|---|---|
committer | Leon Krause <lk@leonkrause.com> | 2018-01-06 15:53:04 +0100 |
commit | cf5b074a95c806c9a49cec98a4e0708dc8fb426f (patch) | |
tree | 1ba522a277bb4ebb9a0f12a220edc92b2073cb04 | |
parent | 50181da8a1be0450cdabb713e571861e83028c29 (diff) |
Fix internal Emscripten JS API calls
Emscripten 1.37.24 no longer exports these by default
-rw-r--r-- | misc/dist/html/default.html | 2 | ||||
-rw-r--r-- | platform/javascript/javascript_main.cpp | 2 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/misc/dist/html/default.html b/misc/dist/html/default.html index 0f78fc640e..a1a4e89d02 100644 --- a/misc/dist/html/default.html +++ b/misc/dist/html/default.html @@ -350,7 +350,7 @@ $GODOT_HEAD_INCLUDE }; function printError(text) { - if (!text.startsWith('**ERROR**: ')) { + if (!String.prototype.trim.call(text).startsWith('**ERROR**: ')) { text = '**ERROR**: ' + text; } print(text); diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index b738f37d1b..e85fe0800f 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { FS.mkdir('/userfs'); FS.mount(IDBFS, {}, '/userfs'); FS.syncfs(true, function(err) { - Module['ccall']('main_after_fs_sync', null, ['string'], [err ? err.message : ""]) + ccall('main_after_fs_sync', null, ['string'], [err ? err.message : ""]) }); ); /* clang-format on */ diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index a86393c950..6d1f75e283 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -566,7 +566,7 @@ void OS_JavaScript::set_css_cursor(const char *p_cursor) { /* clang-format off */ EM_ASM_({ - Module.canvas.style.cursor = Module.UTF8ToString($0); + Module.canvas.style.cursor = UTF8ToString($0); }, p_cursor); /* clang-format on */ } @@ -576,7 +576,7 @@ const char *OS_JavaScript::get_css_cursor() const { char cursor[16]; /* clang-format off */ EM_ASM_INT({ - Module.stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16); + stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16); }, cursor); /* clang-format on */ return cursor; @@ -792,7 +792,7 @@ void OS_JavaScript::main_loop_begin() { /* clang-format off */ EM_ASM_ARGS({ - const send_notification = Module.cwrap('send_notification', null, ['number']); + const send_notification = cwrap('send_notification', null, ['number']); const notifs = arguments; (['mouseover', 'mouseleave', 'focus', 'blur']).forEach(function(event, i) { Module.canvas.addEventListener(event, send_notification.bind(null, notifs[i])); |