Automatically binding extracted methods

André Bargull andre.bargull at
Fri Jun 14 06:22:57 PDT 2013

@@create allows you to set up instance prototypes, here's an amended 
version of your example code using ES6 classes:

The updated version also gets rid of the "origProto" workaround, but 
requires a custom @@hasInstance hook. I've tested the script with [1], 
not sure if the other ES6 runtimes/transpilers already provide support 
for @@create and @@hasInstance.

- André


> Thanks to proxies now having a separate trap for "invoke", we can automatically bind methods on "get". I've written down my thoughts here:
> Axel
> -- 
> Dr. Axel Rauschmayer
> axel at  <>
> home:
> twitter:
> blog:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list