diff options
Diffstat (limited to 'platform/javascript')
-rw-r--r-- | platform/javascript/engine.js | 6 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 4 | ||||
-rw-r--r-- | platform/javascript/os_javascript.h | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js index 552f5a7e02..99d1c20bbd 100644 --- a/platform/javascript/engine.js +++ b/platform/javascript/engine.js @@ -84,10 +84,10 @@ rtenvOpts.print = stdout; if (typeof stderr === 'function') rtenvOpts.printErr = stderr; - if (typeof WebAssembly === 'object' && initializer instanceof WebAssembly.Module) { + if (typeof WebAssembly === 'object' && initializer instanceof ArrayBuffer) { rtenvOpts.instantiateWasm = function(imports, onSuccess) { WebAssembly.instantiate(initializer, imports).then(function(result) { - onSuccess(result); + onSuccess(result.instance); }); return {}; }; @@ -241,7 +241,7 @@ return Promise.reject(new Error("Browser doesn't support WebAssembly")); // TODO cache/retrieve module to/from idb engineLoadPromise = loadPromise(basePath + '.wasm').then(function(xhr) { - return WebAssembly.compile(xhr.response); + return xhr.response; }); } else { var asmjsPromise = loadPromise(basePath + '.asm.js').then(function(xhr) { diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index f103035b27..82a8409615 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -85,6 +85,10 @@ void OS_JavaScript::initialize_core() { FileAccess::make_default<FileAccessBufferedFA<FileAccessUnix> >(FileAccess::ACCESS_RESOURCES); } +void OS_JavaScript::initialize_logger() { + _set_logger(memnew(StdLogger)); +} + void OS_JavaScript::set_opengl_extensions(const char *p_gl_extensions) { ERR_FAIL_COND(!p_gl_extensions); diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 4c6469cb58..1c7bcfef45 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -92,6 +92,7 @@ public: virtual int get_audio_driver_count() const; virtual const char *get_audio_driver_name(int p_driver) const; + virtual void initialize_logger(); virtual void initialize_core(); virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver); @@ -104,11 +105,6 @@ public: //static OS* get_singleton(); - virtual void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type) { - - OS::print_error(p_function, p_file, p_line, p_code, p_rationale, p_type); - } - virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); virtual void set_mouse_mode(MouseMode p_mode); |