Comparing version 0.2.1 to 0.2.2
var dict = require('./dict'); | ||
var fs = require('fs'); | ||
fs.readFileSync = fs.readFileSync || function() {} | ||
require.resolve = require.resolve || function() {} | ||
@@ -5,0 +6,0 @@ var grammar = { |
@@ -7,2 +7,9 @@ var grammar = require('./grammar'); | ||
var parser = new gparser.Parser(); | ||
var _parseError = parser.parseError; | ||
parser.yy.parseError = function() { | ||
parser.yy.ast.initialize(); | ||
_parseError.apply(parser, arguments); | ||
} | ||
return parser; | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "jsonpath", | ||
"description": "Query JavaScript objects with JSONPath expressions. Robust / safe JSONPath engine for Node.js.", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "david@fmail.co.uk", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -127,2 +127,11 @@ var assert = require('assert'); | ||
test('parser ast is reinitialized after parse() throws', function() { | ||
assert.throws(function() { var path = jp.parse('store.book...') }) | ||
var path = jp.parse('$..price'); | ||
assert.deepEqual(path, [ | ||
{ "expression": { "type": "root", "value": "$" } }, | ||
{ "expression": { "type": "identifier", "value": "price" }, "operation": "member", "scope": "descendant"} | ||
]) | ||
}); | ||
}); | ||
@@ -129,0 +138,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
387090
32
7690