Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime: check "for-of" not "=>" for es6 support
- Loading branch information
Showing
1 changed file
with
14 additions
and
14 deletions.
There are no files selected for viewing
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
236039d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, neither
=>
support norfor
/of
support is a reliable indicator of supporting ES6.class
may be a better indicator.236039d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check checks for the set of ES6 features that the code below uses that can’t be transpiled to ES5 (since esbuild’s ES6-to-ES5 transpiler is incomplete). I tried to avoid using such features so the runtime is portable, except I’m using these two features here (
let
andfor
-of
) since the resulting ES6 code is shorter and therefore better when minified. That means the code now needs to versions to work around esbuild’s ES5 limitations. Arrow functions used to be an issue but I have since implemented translation to ES5 for them, so they are no longer an issue.236039d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Sorry for the noise.