Jan 18 meeting notes

David Bruant bruant.d at gmail.com
Thu Jan 19 02:14:20 PST 2012


Le 19/01/2012 02:27, Waldemar Horwat a écrit :
> Waldemar: Opposed to making __proto__ mutate prototypes other than at 
> object construction.  This is getting insanely complex.
Just found a minute ago [1]. At line 50, __proto__ is used. Here, the 
notion of "object construction" is subtle (which is probably one of the 
cases considered to say "This is getting insanely complex"). It has to  
be noted that this is node.js code, which runs on an ES5-capable 
environment.
In this particular case, since no runner is created in the file, a 
standard equivalent to "Runner.prototype.__proto__ = 
EventEmitter.prototype;"
could be:
"Runner.prototype = Object.create(EventEmitter.prototype);"

David

[1] https://github.com/visionmedia/mocha/blob/master/lib/runner.js#L34


More information about the es-discuss mailing list