Comparing version 0.2.3 to 0.2.4
@@ -10,3 +10,5 @@ var grammar = require('./grammar'); | ||
parser.yy.parseError = function() { | ||
parser.yy.ast.initialize(); | ||
if (parser.yy.ast) { | ||
parser.yy.ast.initialize(); | ||
} | ||
_parseError.apply(parser, arguments); | ||
@@ -13,0 +15,0 @@ } |
{ | ||
"name": "jsonpath", | ||
"description": "Query JavaScript objects with JSONPath expressions. Robust / safe JSONPath engine for Node.js.", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"author": "david@fmail.co.uk", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -149,13 +149,17 @@ var assert = require('assert'); | ||
test('parse path with leading member component throws', function() { | ||
assert.throws(function() { var path = jp.parse('.store') }) | ||
assert.throws(function(e) { var path = jp.parse('.store') }, /Expecting 'DOLLAR'/) | ||
}); | ||
test('parse path with leading descendant member throws', function() { | ||
assert.throws(function() { var path = jp.parse('..store') }) | ||
assert.throws(function() { var path = jp.parse('..store') }, /Expecting 'DOLLAR'/) | ||
}); | ||
test('leading script throws', function() { | ||
assert.throws(function() { var path = jp.parse('()') }) | ||
assert.throws(function() { var path = jp.parse('()') }, /Unrecognized text/) | ||
}); | ||
test('first time friendly error', function() { | ||
assert.throws(function() { (new jp.JSONPath).parse('$...') }, /Expecting 'STAR'/) | ||
}); | ||
}); |
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
387088
7718