Add better support for errors.

This commit is contained in:
Richard Dodd 2019-01-16 10:46:26 +00:00
parent 5bffc28631
commit 5f2ba3f98e

View File

@ -414,10 +414,13 @@ impl<'a> Context<'a> {
} catch (_) { } catch (_) {
return 'Object'; return 'Object';
} }
// TODO we could test for more things here, like `Set`s and `Map`s.
} else {
return className;
} }
// errors
if (val instanceof Error) {
return `${className}: ${val.message}\n${val.stack}`;
}
// TODO we could test for more things here, like `Set`s and `Map`s.
return className;
}; };
const val = getObject(i); const val = getObject(i);
const debug = debug_str(val); const debug = debug_str(val);