Skip to content

Commit

Permalink
Update packages/babel-plugin-transform-for-of/src/index.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>
  • Loading branch information
JLHwung and nicolo-ribaudo committed Jun 10, 2022
1 parent 0a1c8e2 commit 9f4a46c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/babel-plugin-transform-for-of/src/index.ts
Expand Up @@ -206,9 +206,9 @@ export default declare((api, options: Options) => {
const right = path.get("right");
if (
right.isArrayExpression() ||
right.isGenericType("Array") ||
// todo(Babel 8): the following line can be removed as it is supported by isGenericType("Array")
t.isArrayTypeAnnotation(right.getTypeAnnotation())
(process.env.BABEL_8_BREAKING
? right.isGenericType("Array")
: right.isGenericType("Array") || t.isArrayTypeAnnotation(right.getTypeAnnotation()))
) {
path.replaceWith(_ForOfStatementArray(path));
return;
Expand Down

0 comments on commit 9f4a46c

Please sign in to comment.