This file contains hidden or 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 SYNTAX //////////////////////////////////////////////////////////////// | |
| class AFoo {} | |
| class ABar extends AFoo {} | |
| // FUNCTION SYNTAX NEAR-EQUIV ////////////////////////////////////////////////// | |
| function BFoo() { | |
| if (!new.target) { | |
| throw new TypeError('Illegal constructor'); |
This file contains hidden or 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
| // This is useful for a few things: | |
| // | |
| // 1. Checking what dictionary options are supported by some platform API. | |
| // 2. Debugging mysterious cases where an object you pass as input to another | |
| // API doesn’t seem to get treated the way you’re expecting. | |
| // 3. When designing another Proxy’s handler implementation, verifying that you | |
| // are accounting for everything correctly and that the intended abstraction | |
| // isn’t leaking in quirky ways. | |
| // | |
| // ex: |
OlderNewer