Permalink
Browse files

Update lib/jsonpath.js

Fix global leak of ret in jsonPath.normalize()
  • Loading branch information...
1 parent 35deb4d commit 489a086eee7d28ee26eb1f14a5942dfb06cd183e @jonathana jonathana committed Oct 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/jsonpath.js
View
2 lib/jsonpath.js
@@ -20,7 +20,7 @@ function jsonPath(obj, expr, arg) {
}
var subx = [];
- ret = expr.replace(/[\['](\??\(.*?\))[\]']/g, function($0,$1){return "[#"+(subx.push($1)-1)+"]";})
+ var ret = expr.replace(/[\['](\??\(.*?\))[\]']/g, function($0,$1){return "[#"+(subx.push($1)-1)+"]";})
.replace(/'?\.'?|\['?/g, ";")
.replace(/;;;|;;/g, ";..;")
.replace(/;$|'?\]|'$/g, "")

0 comments on commit 489a086

Please sign in to comment.