Skip to content

Commit 372452f

Browse files
committed
fix #557: use path parser for array index access
1 parent f4e14f9 commit 372452f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parse/expression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var wsRE = /\s/g
1818
var newlineRE = /\n/g
1919
var saveRE = /[\{,]\s*[\w\$_]+\s*:|'[^']*'|"[^"]*"/g
2020
var restoreRE = /"(\d+)"/g
21-
var pathTestRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\])*$/
21+
var pathTestRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\])*$/
2222
var pathReplaceRE = /[^\w$\.]([A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\])*)/g
2323
var keywordsRE = new RegExp('^(' + keywords.replace(/,/g, '\\b|') + '\\b)')
2424

0 commit comments

Comments
 (0)