Created
October 28, 2015 13:32
-
-
Save joliss/dbb39a2151a1b4e7d085 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (I'm advocating for option -1, until we figure out the right solution, | |
// which is probably somewhere in the solution space of options 1/1a/2.) | |
// option -1: change nothing | |
// option 0: no inheritance, current proposal - breaks `class B extends A { }`, | |
// not really future-proof | |
// option 1: inheritance + just this incantation - ugliness for common case | |
class A { | |
call constructor(...args) { | |
return new function.target(...args); | |
} | |
... | |
// or | |
[Symbol.call](...args) { | |
return new function.target(...args); | |
} | |
} | |
// option 1a: inheritance + incantation + @callable decorator | |
// option 2: inheritance + option 1 + make it default for `class` - starts | |
// "religious war" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment