Skip to content

Commit 2683f24

Browse files
committed
Fix state.pending might be empty array
1 parent 4c72629 commit 2683f24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addon/mode/simple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494

9595
function tokenFunction(states, config) {
9696
return function(stream, state) {
97-
if (state.pending) {
97+
if (state.pending && state.pending.length > 0) {
9898
var pend = state.pending.shift();
9999
if (state.pending.length == 0) state.pending = null;
100100
stream.pos += pend.text.length;

0 commit comments

Comments
 (0)