Skip to content

Commit

Permalink
简化computed的判断
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhh committed Oct 8, 2023
1 parent 7a38467 commit 42947a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/webpack-plugin/lib/template-compiler/bind-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ function checkDelAndGetPath (path) {

// 确定是否可删除
while (!t.isBlockStatement(current)) {
const { key, listKey, computed, node, container } = current
const { key, listKey, node, container } = current
if (
computed || // a[b] => a
(node.computed && !t.isStringLiteral(node.property)) || // a['b']
t.isLogicalExpression(container) || // a && b
(t.isIfStatement(container) && key === 'test') || // if (a) {}
Expand Down

0 comments on commit 42947a4

Please sign in to comment.