You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently after a parse error, parse.yy.ast is carrying left overs from the partially successful parse.
If the next path string has an identical "correct" prefix or the next path string has the same number of components or more, the bug goes unnoticed.
Currently after a parse error, parse.yy.ast is carrying left overs from the partially successful parse.
If the next path string has an identical "correct" prefix or the next path string has the same number of components or more, the bug goes unnoticed.
Example:
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"}
])
});
// Notice left-over component: { expression: { type: 'identifier', value: 'book' }, ... }
AssertionError: [ { expression: { type: 'root', value: '$' } },
{ expression: { type: 'identifier', value: 'book' },
scope: 'child',
o deepEqual [ { expression: { type: 'root', value: '$' } },
{ expression: { type: 'identifier', value: 'price' },
operation: 'member',
The text was updated successfully, but these errors were encountered: