From 7fe83e0daf83e1e20f0683031212a1b428754283 Mon Sep 17 00:00:00 2001 From: peacejj <18829349799@163.com> Date: Tue, 2 Jan 2024 14:51:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=3F.()=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/packages/babelPlugins/proposalOptionalChaining.js | 1 + src/cli/packages/babelPlugins/proposalOptionalChaining.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/cli/packages/babelPlugins/proposalOptionalChaining.js b/packages/cli/packages/babelPlugins/proposalOptionalChaining.js index 36a3df241..864bf680d 100644 --- a/packages/cli/packages/babelPlugins/proposalOptionalChaining.js +++ b/packages/cli/packages/babelPlugins/proposalOptionalChaining.js @@ -63,6 +63,7 @@ module.exports = ((api, options) => { const { object } = chain; let context = scope.maybeGenerateMemoised(object); if (context) { + scope.removeBinding(context.name); chain.object = core_1.types.assignmentExpression('=', context, object); } else if (core_1.types.isSuper(object)) { diff --git a/src/cli/packages/babelPlugins/proposalOptionalChaining.ts b/src/cli/packages/babelPlugins/proposalOptionalChaining.ts index 2b1e3eaef..531c99994 100644 --- a/src/cli/packages/babelPlugins/proposalOptionalChaining.ts +++ b/src/cli/packages/babelPlugins/proposalOptionalChaining.ts @@ -86,6 +86,8 @@ module.exports = ((api, options: Options) => { let context = scope.maybeGenerateMemoised(object); if (context) { + // 移除关联关系 + scope.removeBinding(context.name); chain.object = t.assignmentExpression('=', context, object); } else if (t.isSuper(object)) { context = t.thisExpression(); From 4b08c1c7d5ba56167b5f7d0a441f455e7c4736bc Mon Sep 17 00:00:00 2001 From: peacejj <18829349799@163.com> Date: Tue, 2 Jan 2024 14:52:20 +0800 Subject: [PATCH 2/3] chore: Version to 1.8.28-beta.0 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 3431f884a..63cab6416 100755 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "nanachi-cli", - "version": "1.8.27", + "version": "1.8.28-beta.0", "description": "cli tool for nanachi", "bin": { "nanachi": "./bin/index.js" From a881e59ee2477436613369a5d980b1580aab2fac Mon Sep 17 00:00:00 2001 From: peacejj <18829349799@163.com> Date: Tue, 2 Jan 2024 15:17:09 +0800 Subject: [PATCH 3/3] chore: Version to 1.8.28 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 63cab6416..be077207e 100755 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "nanachi-cli", - "version": "1.8.28-beta.0", + "version": "1.8.28", "description": "cli tool for nanachi", "bin": { "nanachi": "./bin/index.js"