nerd
nerd copied to clipboard
Prototypal inheritance broken
function Bar() {}
Bar.prototype = {b: 100};
var bar = new Bar();
console.log(bar.b);
NodeJS:
$ node prototype.js
100
Nectar:
$ nectar --run prototype.js
[*] Generating source file
[*] Compiling with preset: speed
ld: warning: option -s is obsolete and being ignored
[*] Executing /Users/pestix/dumpster/nectar/prototype
TypeError: Cannot read property 'b' of undefined