Fix stringToPath bug for consecutive [] (#4319)

This commit is contained in:
James Yang
2019-06-08 00:25:16 +08:00
committed by John-David Dalton
parent 8fdf0ed9fa
commit 488e62bd79

View File

@@ -8,7 +8,7 @@ const rePropName = RegExp(
// Or match property names within brackets.
'\\[(?:' +
// Match a non-string expression.
'([^"\'].*)' + '|' +
'([^"\'][^[]*)' + '|' +
// Or match strings (supports escaping characters).
'(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2' +
')\\]'+ '|' +