diff --git a/src/scope.js b/src/scope.js index 77f843d3f..a65cc32c1 100644 --- a/src/scope.js +++ b/src/scope.js @@ -131,7 +131,10 @@ var Scope = { } } else if (str[i] === '.') { // foo.bar - seq.push(name) + // foo.bar[0].foo + // In the case of foo.bar[0].foo, must check length because + // name will be empty after the closing `]` is handled above. + if (name.length) seq.push(name) name = '' } else { // foo.bar