Kill the "shadow-functions.js" internal plugin in favor of an explicit helper (#5677)

* Handle arrow function processing via shared API rather than default plugin.

* Fix a few small PR comments.

* Preserve existing spec arrow 'this' rewrites, and support spec in subclass constructors.
This commit is contained in:
Logan Smyth
2017-05-05 13:27:18 -07:00
committed by GitHub
parent d5aa6d3ff8
commit 14584c218c
33 changed files with 1089 additions and 342 deletions

View File

@@ -139,8 +139,7 @@ export default function () {
if (
state.opts.allowTopLevelThis !== true &&
!path.findParent((path) => !path.is("shadow") &&
THIS_BREAK_KEYS.indexOf(path.type) >= 0)
!path.findParent((path) => THIS_BREAK_KEYS.indexOf(path.type) >= 0)
) {
path.replaceWith(t.identifier("undefined"));
}