json_parse_errors_made_user-friendly.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: John Kleinschmidt <[email protected]>
  3. Date: Thu, 26 May 2022 17:08:33 -0400
  4. Subject: JSON.parse errors made user-friendly
  5. Update tests for https://chromium-review.googlesource.com/c/v8/v8/+/3513684
  6. diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js
  7. index 5be45d0f7af3b6dd483fe3b185c76e41a1bf533b..a99dde30c3d977dfc226a33f632f5f69638892af 100644
  8. --- a/test/es-module/test-esm-data-urls.js
  9. +++ b/test/es-module/test-esm-data-urls.js
  10. @@ -76,7 +76,7 @@ function createBase64URL(mime, body) {
  11. import('data:application/json;foo="test,",0',
  12. { assert: { type: 'json' } }), {
  13. name: 'SyntaxError',
  14. - message: /Unexpected end of JSON input/
  15. + message: 'data:application/json;foo="test,",0: Unterminated string in JSON at position 3 (line 1 column 4)'
  16. });
  17. }
  18. {
  19. diff --git a/test/es-module/test-esm-invalid-pjson.js b/test/es-module/test-esm-invalid-pjson.js
  20. index f3a38018637aa349ad79617ab9835e61d7058fe9..bc78b870c84c4baedecdd7ffc1157c86c307cebf 100644
  21. --- a/test/es-module/test-esm-invalid-pjson.js
  22. +++ b/test/es-module/test-esm-invalid-pjson.js
  23. @@ -18,7 +18,7 @@ describe('ESM: Package.json', { concurrency: true }, () => {
  24. stderr.includes(
  25. `[ERR_INVALID_PACKAGE_CONFIG]: Invalid package config ${invalidJson} ` +
  26. `while importing "invalid-pjson" from ${entry}. ` +
  27. - `Unexpected token } in JSON at position ${12 + checkoutEOL.length * 2}`
  28. + `Expected ':' after property name in JSON at position ${12 + checkoutEOL.length * 2}`
  29. ),
  30. stderr
  31. );