kaluma-project / kaluma

A tiny JavaScript runtime for RP2040 (Raspberry Pi Pico)
https://kalumajs.org
Apache License 2.0
650 stars 38 forks source link

Enhance printing Error object #386

Closed niklauslee closed 3 years ago

niklauslee commented 3 years ago

In Kaluma

> var x = new Error('asfasdf');
undefined
> x
{}
> 

In Node.js

> var x = new Error('asfasdf');
undefined
> x
Error: asfasdf
    at REPL1:1:9
    at Script.runInThisContext (vm.js:133:18)
    at REPLServer.defaultEval (repl.js:484:29)
    at bound (domain.js:413:15)
    at REPLServer.runBound [as eval] (domain.js:424:12)
    at REPLServer.onLine (repl.js:817:10)
    at REPLServer.emit (events.js:327:22)
    at REPLServer.EventEmitter.emit (domain.js:467:12)
    at REPLServer.Interface._onLine (readline.js:337:10)
    at REPLServer.Interface._line (readline.js:666:8)
>