feeley / codeboot

An in-browser JavaScript REPL which supports single-stepping
32 stars 11 forks source link

Custom constructors return undefined #100

Closed 316k closed 6 years ago

316k commented 6 years ago
function Test() {
    this.length = 10;
}

var a = new Test();
print("" + a);
print(a === undefined);

Should return :

[object Object]
false

But codeBoot gives :

undefined
true

This is not a problem for builtins :

> var a = new Date();
> a.toString()
"Thu Oct 19 2017 14:51:33 GMT-0400 (EDT)"
feeley commented 6 years ago

Fixed by commit 83bc663 .