Browse files

Merge pull request #11 from k-kawa/master

declare "ret" as a local variable
  • Loading branch information...
2 parents 35deb4d + ebcb8d4 commit c0b5fabeafed87bf24e341f2c5da186382db9d86 Subbu Allamaraju committed Dec 11, 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 c0b5fab

Please sign in to comment.