Merge pull request #20922 from kripken/err

HTML5: use console.warn instead of Module.printErr
This commit is contained in:
Leon Krause 2018-08-21 03:34:21 +02:00 committed by GitHub
commit e9cb03f33e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -82,7 +82,7 @@ var GodotHTTPRequest = {
godot_xhr_send_string: function(xhrId, strPtr) { godot_xhr_send_string: function(xhrId, strPtr) {
if (!strPtr) { if (!strPtr) {
Module.printErr("Failed to send string per XHR: null pointer"); console.warn("Failed to send string per XHR: null pointer");
return; return;
} }
GodotHTTPRequest.requests[xhrId].send(UTF8ToString(strPtr)); GodotHTTPRequest.requests[xhrId].send(UTF8ToString(strPtr));
@ -90,11 +90,11 @@ var GodotHTTPRequest = {
godot_xhr_send_data: function(xhrId, ptr, len) { godot_xhr_send_data: function(xhrId, ptr, len) {
if (!ptr) { if (!ptr) {
Module.printErr("Failed to send data per XHR: null pointer"); console.warn("Failed to send data per XHR: null pointer");
return; return;
} }
if (len < 0) { if (len < 0) {
Module.printErr("Failed to send data per XHR: buffer length less than 0"); console.warn("Failed to send data per XHR: buffer length less than 0");
return; return;
} }
GodotHTTPRequest.requests[xhrId].send(HEAPU8.subarray(ptr, ptr + len)); GodotHTTPRequest.requests[xhrId].send(HEAPU8.subarray(ptr, ptr + len));

View file

@ -69,7 +69,7 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) {
eval_ret = eval(UTF8ToString(CODE)); eval_ret = eval(UTF8ToString(CODE));
} }
} catch (e) { } catch (e) {
Module.printErr(e); console.warn(e);
eval_ret = null; eval_ret = null;
} }
@ -97,7 +97,7 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) {
if (array_ptr!==0) { if (array_ptr!==0) {
_free(array_ptr) _free(array_ptr)
} }
Module.printErr(e); console.warn(e);
// fall through // fall through
} }
break; break;

View file

@ -788,7 +788,7 @@ bool OS_JavaScript::main_loop_iterate() {
/* clang-format off */ /* clang-format off */
EM_ASM( EM_ASM(
FS.syncfs(function(err) { FS.syncfs(function(err) {
if (err) { Module.printErr('Failed to save IDB file system: ' + err.message); } if (err) { console.warn('Failed to save IDB file system: ' + err.message); }
}); });
); );
/* clang-format on */ /* clang-format on */