-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workaround for Safari for loop lexical scope bug (#567)
* Add workaround for Safari for loop lexical scope bug Safari raises a syntax error for a `let` or `const` declaration in a `for` loop initalization that shadows a parent function's parameter: ```js function a(b) { for (let b;;); } ``` This is valid code, but Safari throws a syntax error. The bug has been [reported](https://bugs.webkit.org/show_bug.cgi?id=171041) and since [fixed](https://trac.webkit.org/changeset/217200/webkit/trunk/Source) in WebKit, so future versions of Safari will not have this problem. This modifies the scope tracker's `canUseInReferencedScopes` method to detect cases where a rename would trigger this bug and use a different name. Fixes #559 * More idiomatic implementation * More extensive tests * Better use path API
- Loading branch information
Showing
2 changed files
with
370 additions
and
0 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
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