Created
March 6, 2015 00:46
-
-
Save ericelliott/1c6f451b2ed1b634c2f2 to your computer and use it in GitHub Desktop.
es7 `new` fix
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
class Point2D { | |
.constructor(x, y) { this.x = x, this.y = y; } | |
.[Symbol.call](x, y) { return new this.constructor(x, y); } | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example by Brendan Eich.
See How to Fix the ES6
class
Keyword for context.