Skip to content

Commit 0672aad

Browse files
committedApr 26, 2021
fix test suite for new '-d DELIM' tests for node >=12
In node 12 the default Error `toString` changed to include the stack.
1 parent 4a69ea3 commit 0672aad

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎lib/json.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ function parseArgv(argv) {
416416
parsed.delim = _parseString(outputDelim);
417417
} catch (parseErr) {
418418
throw new Error(format('could not parse delim "%s": %s',
419-
outputDelim, parseErr));
419+
outputDelim, parseErr.message));
420420
}
421421
break;
422422
case '-D':

‎test/output-delim/expected.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# unsupported JavaScript-only escapes in -d DELIM
2-
json: error: could not parse delim "\0": SyntaxError: Unexpected number in JSON at position 2
3-
json: error: could not parse delim "\x2c": SyntaxError: Unexpected token x in JSON at position 2
2+
json: error: could not parse delim "\0": Unexpected number in JSON at position 2
3+
json: error: could not parse delim "\x2c": Unexpected token x in JSON at position 2

0 commit comments

Comments
 (0)
Please sign in to comment.