Skip to content

Commit

Permalink
Merge branch 'remaxToNanachi'
Browse files Browse the repository at this point in the history
  • Loading branch information
peacejj committed Jan 2, 2024
2 parents abf43b4 + a881e59 commit 74b4cfb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nanachi-cli",
"version": "1.8.27",
"version": "1.8.28",
"description": "cli tool for nanachi",
"bin": {
"nanachi": "./bin/index.js"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 2 additions & 0 deletions src/cli/packages/babelPlugins/proposalOptionalChaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 74b4cfb

Please sign in to comment.