Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

declare "ret" as a local variable #11

Merged
merged 1 commit into from

4 participants

@k-kawa

Hi!
I fixed a minor bug.

Regards

@Filirom1

Like #12 +1

@VirgileD

yes, really need #11 or #12 (which are the same), because mocha breaks badly on this undeclared ret variable.
++++++1

@s3u s3u merged commit c0b5fab into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 30, 2012
  1. declare "ret" as a local variable

    Kohei Kawasaki authored
This page is out of date. Refresh to see the latest.
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, "")
Something went wrong with that request. Please try again.