Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Dec 4, 2023
1 parent 8a2da65 commit 44c0302
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/babel-plugin-transform-for-of/package.json
Expand Up @@ -17,7 +17,8 @@
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "workspace:^"
"@babel/helper-plugin-utils": "workspace:^",
"@babel/helper-skip-transparent-expression-wrappers": "workspace:^"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-plugin-transform-for-of/src/index.ts
Expand Up @@ -3,6 +3,7 @@ import { template, types as t } from "@babel/core";
import type { NodePath } from "@babel/traverse";

import transformWithoutHelper from "./no-helper-implementation.ts";
import { skipTransparentExprWrapperNodes } from "@babel/helper-skip-transparent-expression-wrappers";

export interface Options {
allowArrayLike?: boolean;
Expand Down Expand Up @@ -89,10 +90,13 @@ export default declare((api, options: Options) => {
visitor: {
ForOfStatement(path) {
const { scope } = path;
const { left, right, await: isAwait } = path.node;
const { left, await: isAwait } = path.node;
if (isAwait) {
return;
}
const right: t.Expression = skipTransparentExprWrapperNodes(

Check failure on line 97 in packages/babel-plugin-transform-for-of/src/index.ts

View workflow job for this annotation

GitHub Actions / Publish to local Verdaccio registry

Type 'Super | Expression' is not assignable to type 'Expression'.

Check failure on line 97 in packages/babel-plugin-transform-for-of/src/index.ts

View workflow job for this annotation

GitHub Actions / Build Babel 8 Artifacts

Type 'Super | Expression' is not assignable to type 'Expression'.
path.node.right,
);
const i = scope.generateUidIdentifier("i");
let array: t.Identifier | t.ThisExpression =
scope.maybeGenerateMemoised(right, true);
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Expand Up @@ -2724,6 +2724,7 @@ __metadata:
"@babel/core": "workspace:^"
"@babel/helper-plugin-test-runner": "workspace:^"
"@babel/helper-plugin-utils": "workspace:^"
"@babel/helper-skip-transparent-expression-wrappers": "workspace:^"
peerDependencies:
"@babel/core": ^7.0.0-0
languageName: unknown
Expand Down

0 comments on commit 44c0302

Please sign in to comment.