Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jsonata.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ var jsonata = (function() {
var err = {
code: code,
position: node.position,
token: node.id,
token: node.value,
value: id
};
return handleError(err);
Expand Down
9 changes: 9 additions & 0 deletions test/jsonata-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5873,6 +5873,15 @@ describe('Evaluator - errors', function () {
});
});

describe('$replace("foo", "o, "rr")', function () {
it('should throw error', function () {
expect(function () {
jsonata('$replace("foo", "o, "rr")');
}).to.throw()
.to.deep.contain({position: 24, code: 'S0202', token: 'rr"', value: ')'});
});
});

describe('[1!2]', function () {
it('should throw error', function () {
expect(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/parser-recovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('Invoke parser with incomplete expression', function() {
{
"code": "S0202",
"position": 16,
"token": "(literal)",
"token": "0",
"value": "]",
"remaining": [
{
Expand Down