Skip to content

Commit

Permalink
Merge pull request #1515 from didi/feat-bind-this
Browse files Browse the repository at this point in the history
优化 MemberExpression 逻辑
  • Loading branch information
hiyuki authored Jul 16, 2024
2 parents 45c7fd9 + 68490c8 commit e749c3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 2 additions & 6 deletions packages/webpack-plugin/lib/template-compiler/bind-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,8 @@ function checkDelAndGetPath (path) {
}

if (t.isMemberExpression(parent) && parent.computed) {
if (key === 'property') {
replace = true
} else {
canDel = false
break
}
canDel = false
break
}

if (t.isLogicalExpression(parent)) { // case: a || ((b || c) && d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ global.currentInject.render = function (_i, _c, _r, _sc) {
global.currentInject.render = function (_i, _c, _r, _sc) {
if (_c("a.b")) {}
_sc("c");
_sc("a")[""];
_c("a.b")[""];
_sc("a")[_sc("c")];
_c("a.b")[_c("c.d")];
_sc("e");
};`
Expand Down Expand Up @@ -379,8 +377,7 @@ global.currentInject.render = function (_i, _c, _r, _sc) {
global.currentInject.render = function (_i, _c, _r, _sc) {
this.name;
this.name2;
this.name3[""];
this.name3[this.name2];
this.name4 && this.name4.length;
this.name4['length'];
Expand Down

0 comments on commit e749c3f

Please sign in to comment.