1
0
Fork 0

issue #1944: nicer error logging in console.log()

This commit is contained in:
Jan Steemann 2016-07-18 10:55:52 +02:00
parent 306ea79e18
commit dc51d9dea5
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ global.DEFINE_MODULE('console', (function () {
if (typeof arg === 'object') {
if (arg === null) {
arg = 'null';
} else if (arg instanceof Error) {
arg = String(arg);
} else if (arg instanceof Date || arg instanceof RegExp) {
arg = String(arg);
} else if (Object.prototype.isPrototypeOf(arg) || Array.isArray(arg)) {