Skip to content

Commit

Permalink
Revert "feat!: implement facebook/react#21104 close Jack-Works#4 (Jac…
Browse files Browse the repository at this point in the history
…k-Works#5)", close Jack-Works#2

This reverts commit be48fbe.
  • Loading branch information
Jack-Works committed May 22, 2021
1 parent 1964d4a commit 9458493
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
6 changes: 0 additions & 6 deletions tests/hooks-support-IIFE.js

This file was deleted.

10 changes: 0 additions & 10 deletions typescript/__snapshots__/hooks-support-IIFE.js

This file was deleted.

7 changes: 0 additions & 7 deletions typescript/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ export default function (opts: Options = {}): TransformerFactory<SourceFile> {
node = newFunction
// if it is an inner decl, we can update it safely
if (findAncestor(oldNode.parent, ts.isFunctionLike)) node = wrapped
else if (isIIFEFunction(oldNode)) return wrapped
}
}
return updateStatements(node, addSignatureReport)
Expand Down Expand Up @@ -647,12 +646,6 @@ export default function (opts: Options = {}): TransformerFactory<SourceFile> {
if (['createElement', 'jsx', 'jsxs', 'jsxDEV'].includes(f)) return true
return false
}
function isIIFEFunction(f: HandledFunction): boolean {
let node: Node = f
while (ts.isParenthesizedExpression(node.parent)) node = node.parent
if (ts.isCallExpression(node.parent) && node.parent.expression === node) return true
return false
}
}

function startsWithLowerCase(str: string) {
Expand Down

0 comments on commit 9458493

Please sign in to comment.