(How) does proto operator distiguish between function and non-function in LHS?

Herby Vojčík herby at mailbox.sk
Sat Jan 28 00:28:50 PST 2012


The proposal for <| cites these usage examples:

- Setting the prototype of a function to something other than 
Function.prototype

     let f = EnhancedFunctionPrototype <| function () {}

- Parrallel constructor/instance prototype chains

     let superclass = function () {};
     //define a constructor method
     superclass.new = function () {return (new this()).initialize()};
     //define a instance method
     superclass.prototype.initialize = function () {return this};
     let subclass = superclass <| function () {};
     ...

Question: When RHS is function expression, does it distinguish if LHS is 
function to select one of the (different) behaviours from above?

Herby


More information about the es-discuss mailing list