Subclassing Function

Francisco Tolmasky tolmasky at
Thu May 7 19:50:19 UTC 2015

In the existing implementations I’ve tried, it appears I can’t do this:

class SuperFunction extends Function { }

(also tried with constructor(str) { super(str) })

It “works”, but the resulting new SuperFunction(“return 5”) is just a
Function, not a SuperFunction. Is Function meants to be an exception to the
subclassing built-ins, or should it also work?



Francisco Tolmasky
tolmasky at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list