-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3513684: JSON.parse errors made user-friendly
- Loading branch information
1 parent
77ac92d
commit b1e4218
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: John Kleinschmidt <jkleinsc@electronjs.org> | ||
Date: Thu, 26 May 2022 17:08:33 -0400 | ||
Subject: JSON.parse errors made user-friendly | ||
|
||
Update tests for https://chromium-review.googlesource.com/c/v8/v8/+/3513684 | ||
|
||
diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js | ||
index 9d0deb70a1568c93ccdecbef59327ecb2a17ae5e..2ab8f2bdcf7cca1437df33668c4177a76b4dc3ca 100644 | ||
--- a/test/es-module/test-esm-data-urls.js | ||
+++ b/test/es-module/test-esm-data-urls.js | ||
@@ -75,7 +75,7 @@ function createBase64URL(mime, body) { | ||
import('data:application/json;foo="test,",0', | ||
{ assert: { type: 'json' } }), { | ||
name: 'SyntaxError', | ||
- message: /Unexpected end of JSON input/ | ||
+ message: 'data:application/json;foo="test,",0: Unterminated string in JSON at position 3' | ||
}); | ||
} | ||
{ | ||
diff --git a/test/es-module/test-esm-invalid-pjson.js b/test/es-module/test-esm-invalid-pjson.js | ||
index cdbebb17b4bb34421a2f98c384650d495908885c..12247f15dbaddc0e06f1e6aff09faf7a035cf43a 100644 | ||
--- a/test/es-module/test-esm-invalid-pjson.js | ||
+++ b/test/es-module/test-esm-invalid-pjson.js | ||
@@ -17,11 +17,13 @@ child.stderr.on('data', (data) => { | ||
child.on('close', mustCall((code, signal) => { | ||
strictEqual(code, 1); | ||
strictEqual(signal, null); | ||
+ console.log('STDERR is: ', stderr); | ||
+ console.log('DONE STDERR'); | ||
ok( | ||
stderr.includes( | ||
`[ERR_INVALID_PACKAGE_CONFIG]: Invalid package config ${invalidJson} ` + | ||
`while importing "invalid-pjson" from ${entry}. ` + | ||
- `Unexpected token } in JSON at position ${12 + checkoutEOL.length * 2}` | ||
+ `Expected ':' after property name in JSON at position ${12 + checkoutEOL.length * 2}` | ||
), | ||
stderr); | ||
})); |