Skip to content

Commit 31cc52c

Browse files
committed
fix: parseEndTag方法中currentParent指向错误 #2
1 parent a3413b2 commit 31cc52c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: 《template 模板是怎样通过 Compile 编译的》.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ function parseEndTag (tagName) {
7676
}
7777

7878
if (pos >= 0) {
79+
if (pos > 0) {
80+
currentParent = stack[pos - 1];
81+
} else {
82+
currentParent = null;
83+
}
7984
stack.length = pos;
80-
currentParent = stack[pos];
8185
}
8286
}
8387

0 commit comments

Comments
 (0)