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
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to