From 0faf752cdc55b3d027e152076784d62f41b0bd90 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 7 Dec 2025 06:23:00 -0800 Subject: [PATCH] test: update test426 fixtures Update test426 fixtures for source map tests. Refs: https://github.com/tc39/source-map-tests --- test/fixtures/test426/README.md | 9 +- test/fixtures/test426/decoding/README.md | 16 ++ .../debug-id/debug-id-index-section.map | 29 +++ .../debug-id-index-section.map.golden | 5 + .../decoding/debug-id/debug-id-index.map | 30 +++ .../debug-id/debug-id-index.map.golden | 6 + .../test426/decoding/debug-id/debug-id.d.ts | 6 + .../test426/decoding/debug-id/debug-id.map | 6 + .../decoding/debug-id/debug-id.map.golden | 6 + .../decoding/debug-id/invalid-debug-id.error | 0 .../decoding/debug-id/invalid-debug-id.map | 6 + .../debug-id/invalid-debug-id.map.golden | 5 + .../close-start-end-position-scopes.map | 10 + ...close-start-end-position-scopes.map.golden | 73 +++++++ .../decoding/scopes/empty-scopes-field.map | 8 + .../scopes/empty-scopes-field.map.golden | 6 + ...multiple-root-original-scopes-with-nil.map | 14 ++ ...e-root-original-scopes-with-nil.map.golden | 53 +++++ .../test426/decoding/scopes/nested-scopes.map | 14 ++ .../decoding/scopes/nested-scopes.map.golden | 75 +++++++ .../test426/decoding/scopes/nil-scopes.map | 13 ++ .../decoding/scopes/nil-scopes.map.golden | 31 +++ .../decoding/scopes/scope-variables.map | 23 ++ .../scopes/scope-variables.map.golden | 86 ++++++++ .../test426/decoding/scopes/scopes.d.ts | 48 +++++ .../decoding/scopes/sibling-scopes.map | 16 ++ .../decoding/scopes/sibling-scopes.map.golden | 88 ++++++++ .../scopes/single-root-original-scope.map | 12 ++ .../single-root-original-scope.map.golden | 43 ++++ .../test426/decoding/source-map-record.d.ts | 44 ++++ .../range-mappings-proposal-tests.json | 203 ++++++++++++++++++ .../proposals/range-mappings/empty-string.js | 1 + .../range-mappings/empty-string.js.map | 9 + .../range-mappings/invalid-base64-char-1.js | 1 + .../invalid-base64-char-1.js.map | 9 + .../range-mappings/invalid-base64-char-2.js | 1 + .../invalid-base64-char-2.js.map | 9 + .../range-mappings/multiple-mappings.js | 3 + .../range-mappings/multiple-mappings.js.map | 8 + .../range-mappings/newline-semantics.js | 3 + .../range-mappings/newline-semantics.js.map | 9 + .../range-mappings/non-full-line-coverage.js | 3 + .../non-full-line-coverage.js.map | 9 + .../range-mappings/out-of-range-2.js | 2 + .../range-mappings/out-of-range-2.js.map | 9 + .../proposals/range-mappings/out-of-range.js | 2 + .../range-mappings/out-of-range.js.map | 9 + .../proposals/range-mappings/simple.js | 3 + .../proposals/range-mappings/simple.js.map | 9 + .../proposals/range-mappings/wrong-type-1.js | 1 + .../range-mappings/wrong-type-1.js.map | 9 + .../proposals/range-mappings/wrong-type-2.js | 1 + .../range-mappings/wrong-type-2.js.map | 9 + .../proposals/range-mappings/wrong-type-3.js | 1 + .../range-mappings/wrong-type-3.js.map | 9 + .../test426/source-map-spec-tests.json | 2 +- test/test426/README.md | 2 +- 57 files changed, 1113 insertions(+), 4 deletions(-) create mode 100644 test/fixtures/test426/decoding/README.md create mode 100644 test/fixtures/test426/decoding/debug-id/debug-id-index-section.map create mode 100644 test/fixtures/test426/decoding/debug-id/debug-id-index-section.map.golden create mode 100644 test/fixtures/test426/decoding/debug-id/debug-id-index.map create mode 100644 test/fixtures/test426/decoding/debug-id/debug-id-index.map.golden create mode 100644 test/fixtures/test426/decoding/debug-id/debug-id.d.ts create mode 100644 test/fixtures/test426/decoding/debug-id/debug-id.map create mode 100644 test/fixtures/test426/decoding/debug-id/debug-id.map.golden create mode 100644 test/fixtures/test426/decoding/debug-id/invalid-debug-id.error create mode 100644 test/fixtures/test426/decoding/debug-id/invalid-debug-id.map create mode 100644 test/fixtures/test426/decoding/debug-id/invalid-debug-id.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map create mode 100644 test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/empty-scopes-field.map create mode 100644 test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map create mode 100644 test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/nested-scopes.map create mode 100644 test/fixtures/test426/decoding/scopes/nested-scopes.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/nil-scopes.map create mode 100644 test/fixtures/test426/decoding/scopes/nil-scopes.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/scope-variables.map create mode 100644 test/fixtures/test426/decoding/scopes/scope-variables.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/scopes.d.ts create mode 100644 test/fixtures/test426/decoding/scopes/sibling-scopes.map create mode 100644 test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden create mode 100644 test/fixtures/test426/decoding/scopes/single-root-original-scope.map create mode 100644 test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden create mode 100644 test/fixtures/test426/decoding/source-map-record.d.ts create mode 100644 test/fixtures/test426/range-mappings-proposal-tests.json create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/empty-string.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/empty-string.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/simple.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/simple.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js.map create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js create mode 100644 test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js.map diff --git a/test/fixtures/test426/README.md b/test/fixtures/test426/README.md index e3e353fd500458..1eb2818fcfa992 100644 --- a/test/fixtures/test426/README.md +++ b/test/fixtures/test426/README.md @@ -1,9 +1,9 @@ # Source Map Tests -This repository holds testing discussions and tests for the the Source Map debugging format. Specifically, we're looking to encourage discussion around: +This repository holds discussions on testing and tests for the Source Map debugging format. Specifically, we're looking to encourage discussion around: - Manual and automated testing strategies for Source Maps -- Gathering a list of Soure Map generators and consumers +- Gathering a list of Source Map generators and consumers - General discussion around deviations between source maps Open discussion happens in the [GitHub issues](https://github.com/source-map/source-map-tests/issues). @@ -53,3 +53,8 @@ How to run in Chrome Devtools: * Run `git apply ` in `devtools-frontend` repo More information about running Chrome Devtools without building Chromium can be found [here](https://chromium.googlesource.com/devtools/devtools-frontend/+/refs/heads/chromium/3965/README.md) + +#### Node.js + +Follow the [running Node.js tests guide](https://github.com/nodejs/node/blob/main/BUILDING.md#running-tests) to build Node.js and run tests locally. +Read more about running the source map tests at [here](https://github.com/nodejs/node/tree/main/test/test426). diff --git a/test/fixtures/test426/decoding/README.md b/test/fixtures/test426/decoding/README.md new file mode 100644 index 00000000000000..57b47c0f042f57 --- /dev/null +++ b/test/fixtures/test426/decoding/README.md @@ -0,0 +1,16 @@ +# Decoding tests + +This directory contains various source map files along with expectations to help implementations verify source map decoding. + +Each source map `.map`, is accompanied by: + + * a `.map.golden` file, containing a [Decoded Source Map Record](https://tc39.es/ecma426/#decoded-source-map-record) in JSON format + * an optional `.map.error` file. It is present for source maps where the spec would ["optionally report an error"](https://tc39.es/ecma426/#sec-optional-errors). At the moment, the `.error` file only serves as a marker. But in the future it may be turned into a JSON with more information about the number and specifics of the expected errors. + +## .golden format + +The JSON format of the `.golden` files, attempts to follow the [Decoded Source Map Record](https://tc39.es/ecma426/#decoded-source-map-record) closely, but since the "Decoded Source Map Record" has cycles, we deviate slightly. The exact format is documented in [./source-map-record.d.ts](./source-map-record.d.ts). + +## Proposals + +Each source map proposal gets its own sub-directory. If a proposal adds new specification records or extends existing records, the sub-directory should contain a separate `/.d.ts` that describes the extended golden files. See [./scopes/scopes.d.ts](./scopes/scopes.d.ts) as an example. Once a proposal reaches stage 4, the `/.d.ts` file is merged into the [./source-map-record.d.ts](./source-map-record.d.ts). diff --git a/test/fixtures/test426/decoding/debug-id/debug-id-index-section.map b/test/fixtures/test426/decoding/debug-id/debug-id-index-section.map new file mode 100644 index 00000000000000..9c6f3fbde1edfa --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/debug-id-index-section.map @@ -0,0 +1,29 @@ +{ + "version": 3, + "file": "app.js", + "sections": [{ + "offset": { + "line": 0, + "column": 0, + }, + "map": { + "version": 3, + "file": "component1.js", + "sources": [], + "mappings": "", + "debugId": "a938a92f-3074-41f7-bfdb-1038430a983c" + } + }, { + "offset": { + "line": 1, + "column": 0, + }, + "map": { + "version": 3, + "file": "component2.js", + "sources": [], + "mappings": "", + "debugId": "8cf3d888-fc9e-457d-a999-6ffef384b736" + } + }] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/debug-id/debug-id-index-section.map.golden b/test/fixtures/test426/decoding/debug-id/debug-id-index-section.map.golden new file mode 100644 index 00000000000000..7c3a8456e6b0f7 --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/debug-id-index-section.map.golden @@ -0,0 +1,5 @@ +{ + "file": "app.js", + "sources": [], + "mappings": [], +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/debug-id/debug-id-index.map b/test/fixtures/test426/decoding/debug-id/debug-id-index.map new file mode 100644 index 00000000000000..11de486e1a9a2a --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/debug-id-index.map @@ -0,0 +1,30 @@ +{ + "version": 3, + "file": "app.js", + "debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c", + "sections": [{ + "offset": { + "line": 0, + "column": 0, + }, + "map": { + "version": 3, + "file": "component1.js", + "sources": [], + "mappings": "", + "debugId": "a938a92f-3074-41f7-bfdb-1038430a983c" + } + }, { + "offset": { + "line": 1, + "column": 0, + }, + "map": { + "version": 3, + "file": "component2.js", + "sources": [], + "mappings": "", + "debugId": "8cf3d888-fc9e-457d-a999-6ffef384b736" + } + }] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/debug-id/debug-id-index.map.golden b/test/fixtures/test426/decoding/debug-id/debug-id-index.map.golden new file mode 100644 index 00000000000000..70c07024697bb3 --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/debug-id-index.map.golden @@ -0,0 +1,6 @@ +{ + "file": "app.js", + "sources": [], + "mappings": [], + "debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/debug-id/debug-id.d.ts b/test/fixtures/test426/decoding/debug-id/debug-id.d.ts new file mode 100644 index 00000000000000..1f9862f012ec2b --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/debug-id.d.ts @@ -0,0 +1,6 @@ + +/// + +interface SourceMapRecord { + debugId: string|null; +} diff --git a/test/fixtures/test426/decoding/debug-id/debug-id.map b/test/fixtures/test426/decoding/debug-id/debug-id.map new file mode 100644 index 00000000000000..a876b3f91b6d30 --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/debug-id.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": [], + "mappings": "", + "debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/debug-id/debug-id.map.golden b/test/fixtures/test426/decoding/debug-id/debug-id.map.golden new file mode 100644 index 00000000000000..010e6f9186d111 --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/debug-id.map.golden @@ -0,0 +1,6 @@ +{ + "file": null, + "sources": [], + "mappings": [], + "debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/debug-id/invalid-debug-id.error b/test/fixtures/test426/decoding/debug-id/invalid-debug-id.error new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/test/fixtures/test426/decoding/debug-id/invalid-debug-id.map b/test/fixtures/test426/decoding/debug-id/invalid-debug-id.map new file mode 100644 index 00000000000000..0b470d8c69a113 --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/invalid-debug-id.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": [], + "mappings": "", + "debugId": "this is not a UUID" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/debug-id/invalid-debug-id.map.golden b/test/fixtures/test426/decoding/debug-id/invalid-debug-id.map.golden new file mode 100644 index 00000000000000..9e0b0c1d817fa9 --- /dev/null +++ b/test/fixtures/test426/decoding/debug-id/invalid-debug-id.map.golden @@ -0,0 +1,5 @@ +{ + "file": null, + "sources": [], + "mappings": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map new file mode 100644 index 00000000000000..d072e199df26c0 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map @@ -0,0 +1,10 @@ +{ + "version": 3, + "file": "close-start-end-position-scopes.js", + "sources": [ + "original_0.js" + ], + "mappings": "", + "names": [], + "scopes": "BAAA,BAAA,CAB,BAAA,CAB,BAAB,CAC,CBA" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden new file mode 100644 index 00000000000000..3b2f5e80a5fa8a --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden @@ -0,0 +1,73 @@ +{ + "file": "close-start-end-position-scopes.js", + "mappings": [], + "sources": [ + { + "url": "original_0.js", + "content": null, + "ignored": false, + "scope": { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + }, + "name": null, + "kind": null, + "isStackFrame": false, + "variables": [], + "children": [ + { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 0, + "column": 1 + }, + "name": null, + "kind": null, + "isStackFrame": false, + "variables": [], + "children": [] + }, + { + "start": { + "line": 0, + "column": 1 + }, + "end": { + "line": 0, + "column": 2 + }, + "name": null, + "kind": null, + "isStackFrame": false, + "variables": [], + "children": [] + }, + { + "start": { + "line": 0, + "column": 3 + }, + "end": { + "line": 0, + "column": 5 + }, + "name": null, + "kind": null, + "isStackFrame": false, + "variables": [], + "children": [] + } + ] + } + } + ], + "ranges": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/empty-scopes-field.map b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map new file mode 100644 index 00000000000000..6f5baa6a0bf6b9 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "file": "empty-scopes-field.js", + "sources": [], + "mappings": "", + "names": [], + "scopes": "" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden new file mode 100644 index 00000000000000..51eccb2cf95fb1 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden @@ -0,0 +1,6 @@ +{ + "file": "empty-scopes-field.js", + "mappings": [], + "sources": [], + "ranges": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map new file mode 100644 index 00000000000000..3eaa7daa1c1aaf --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "file": "multiple-root-original-scopes-with-nil.js", + "sources": [ + "original_0.js", + "original_1.js", + "original_2.js" + ], + "mappings": "", + "names": [ + "global" + ], + "scopes": "BCAAA,CKA,A,BCAAA,CKA" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden new file mode 100644 index 00000000000000..2e69392b210019 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden @@ -0,0 +1,53 @@ +{ + "file": "multiple-root-original-scopes-with-nil.js", + "mappings": [], + "sources": [ + { + "url": "original_0.js", + "content": null, + "ignored": false, + "scope": { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 10, + "column": 0 + }, + "name": null, + "kind": "global", + "isStackFrame": false, + "variables": [], + "children": [] + } + }, + { + "url": "original_1.js", + "content": null, + "ignored": false, + "scope": null + }, + { + "url": "original_2.js", + "content": null, + "ignored": false, + "scope": { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 10, + "column": 0 + }, + "name": null, + "kind": "global", + "isStackFrame": false, + "variables": [], + "children": [] + } + } + ], + "ranges": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/nested-scopes.map b/test/fixtures/test426/decoding/scopes/nested-scopes.map new file mode 100644 index 00000000000000..348668b216bdfd --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/nested-scopes.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "file": "nested-scopes.js", + "sources": [ + "original_0.js" + ], + "mappings": "", + "names": [ + "originalFunctionFoo", + "innerOriginalFunction", + "block" + ], + "scopes": "BAAA,BFKAA,BFFCC,BCFEE,CFE,CBC,CBA,CBA" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/nested-scopes.map.golden b/test/fixtures/test426/decoding/scopes/nested-scopes.map.golden new file mode 100644 index 00000000000000..d2fc9d2d310b5a --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/nested-scopes.map.golden @@ -0,0 +1,75 @@ +{ + "file": "nested-scopes.js", + "mappings": [], + "sources": [ + { + "url": "original_0.js", + "content": null, + "ignored": false, + "scope": { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 28, + "column": 0 + }, + "name": null, + "kind": null, + "isStackFrame": false, + "variables": [], + "children": [ + { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 27, + "column": 0 + }, + "name": "originalFunctionFoo", + "kind": null, + "isStackFrame": true, + "variables": [], + "children": [ + { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 26, + "column": 2 + }, + "name": "innerOriginalFunction", + "kind": null, + "isStackFrame": true, + "variables": [], + "children": [ + { + "start": { + "line": 20, + "column": 4 + }, + "end": { + "line": 25, + "column": 4 + }, + "name": null, + "kind": "block", + "isStackFrame": false, + "variables": [], + "children": [] + } + ] + } + ] + } + ] + } + } + ], + "ranges": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/nil-scopes.map b/test/fixtures/test426/decoding/scopes/nil-scopes.map new file mode 100644 index 00000000000000..88b20314e3b192 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/nil-scopes.map @@ -0,0 +1,13 @@ +{ + "version": 3, + "file": "nil-scopes.js", + "sources": [ + "original_0.js", + "original_1.js", + "original_2.js", + "original_3.js" + ], + "mappings": "", + "names": [], + "scopes": "A,A,A,A" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/nil-scopes.map.golden b/test/fixtures/test426/decoding/scopes/nil-scopes.map.golden new file mode 100644 index 00000000000000..93e7854420fb17 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/nil-scopes.map.golden @@ -0,0 +1,31 @@ +{ + "file": "nil-scopes.js", + "mappings": [], + "sources": [ + { + "url": "original_0.js", + "content": null, + "ignored": false, + "scope": null + }, + { + "url": "original_1.js", + "content": null, + "ignored": false, + "scope": null + }, + { + "url": "original_2.js", + "content": null, + "ignored": false, + "scope": null + }, + { + "url": "original_3.js", + "content": null, + "ignored": false, + "scope": null + } + ], + "ranges": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/scope-variables.map b/test/fixtures/test426/decoding/scopes/scope-variables.map new file mode 100644 index 00000000000000..921c929abc475d --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/scope-variables.map @@ -0,0 +1,23 @@ +{ + "version": 3, + "file": "scope-variables.js", + "sources": [ + "original_0.js" + ], + "mappings": "", + "names": [ + "global", + "GLOBAL_CONSTANT1", + "GLOBAL_CONSTANT2", + "toplevelFunction1", + "function", + "functionScopedVariable1", + "functionScopedVariable2", + "functionScopedVariable3", + "toplevelFunction2", + "block", + "blockScopedVariable1", + "blockScopedVariable2" + ], + "scopes": "BCAAA,DCC,BHKFGI,DGCC,CJB,BHGFKA,DF,BCBIK,DKC,CDF,CBB,CBA" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/scope-variables.map.golden b/test/fixtures/test426/decoding/scopes/scope-variables.map.golden new file mode 100644 index 00000000000000..8af29866adc09f --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/scope-variables.map.golden @@ -0,0 +1,86 @@ +{ + "file": "scope-variables.js", + "mappings": [], + "sources": [ + { + "url": "original_0.js", + "content": null, + "ignored": false, + "scope": { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 31, + "column": 0 + }, + "name": null, + "kind": "global", + "isStackFrame": false, + "variables": [ + "GLOBAL_CONSTANT1", + "GLOBAL_CONSTANT2" + ], + "children": [ + { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 19, + "column": 1 + }, + "name": "toplevelFunction1", + "kind": "function", + "isStackFrame": true, + "variables": [ + "functionScopedVariable1", + "functionScopedVariable2", + "functionScopedVariable3" + ], + "children": [] + }, + { + "start": { + "line": 25, + "column": 5 + }, + "end": { + "line": 30, + "column": 1 + }, + "name": "toplevelFunction2", + "kind": "function", + "isStackFrame": true, + "variables": [ + "functionScopedVariable1" + ], + "children": [ + { + "start": { + "line": 26, + "column": 8 + }, + "end": { + "line": 29, + "column": 5 + }, + "name": null, + "kind": "block", + "isStackFrame": false, + "variables": [ + "blockScopedVariable1", + "blockScopedVariable2" + ], + "children": [] + } + ] + } + ] + } + } + ], + "ranges": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/scopes.d.ts b/test/fixtures/test426/decoding/scopes/scopes.d.ts new file mode 100644 index 00000000000000..770fc8d7d8feb7 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/scopes.d.ts @@ -0,0 +1,48 @@ + +/// + +interface SourceMapRecord { + ranges: GeneratedRangeRecord[]; +} + +interface SourceRecord { + scope: OriginalScopeRecord|null; +} + +/** + * Corresponds to a [Original Scope Record](https://tc39.es/ecma426/branch/proposal-scopes/#sec-original-scope-record-type) + */ +interface OriginalScopeRecord { + start: PositionRecord; + end: PositionRecord; + name: string|null; + kind: string|null; + isStackFrame: boolean; + variables: string[]; + children: OriginalScopeRecord[]; +} + +/** + * Corresponds to a [Generated Range Record](https://tc39.es/ecma426/branch/proposal-scopes/#sec-generated-range-record-type) + */ +interface GeneratedRangeRecord { + start: PositionRecord; + end: PositionRecord; + /** + * An index into a flattened list of {@link OriginalScopeRecord}. The flattened list is obtained by iterating + * {@link SourceMapRecord.sources} from `0` to `SourceMapRecord.sources.length` and traverse each {@link SourceRecord.scope} in [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR). + */ + definitionIndex: number|null; + stackFrameType: 'none'|'original'|'hidden'; + bindings: BindingRecord[][]; + callSite: OriginalPositionRecord|null; + children: GeneratedRangeRecord[]; +} + +/** + * Corresponds to a [Binding Record](https://tc39.es/ecma426/branch/proposal-scopes/#sec-binding-record-type) + */ +interface BindingRecord { + from: PositionRecord; + binding: string|null; +} diff --git a/test/fixtures/test426/decoding/scopes/sibling-scopes.map b/test/fixtures/test426/decoding/scopes/sibling-scopes.map new file mode 100644 index 00000000000000..630a8c094a429a --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/sibling-scopes.map @@ -0,0 +1,16 @@ +{ + "version": 3, + "file": "sibling-scopes.js", + "sources": [ + "original_0.js" + ], + "mappings": "", + "names": [ + "toplevelFunction1", + "function", + "toplevelFunction2", + "toplevelFunction3", + "toplevelFunction4" + ], + "scopes": "BAAA,BHKFAC,CIB,BHCFEA,CIB,BHCFCA,CIB,BHCFCA,CIB,CCA" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden b/test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden new file mode 100644 index 00000000000000..54f49fa7ca9e9a --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden @@ -0,0 +1,88 @@ +{ + "file": "sibling-scopes.js", + "mappings": [], + "sources": [ + { + "url": "original_0.js", + "content": null, + "ignored": false, + "scope": { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 50, + "column": 0 + }, + "name": null, + "kind": null, + "isStackFrame": false, + "variables": [], + "children": [ + { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 18, + "column": 1 + }, + "name": "toplevelFunction1", + "kind": "function", + "isStackFrame": true, + "variables": [], + "children": [] + }, + { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 28, + "column": 1 + }, + "name": "toplevelFunction2", + "kind": "function", + "isStackFrame": true, + "variables": [], + "children": [] + }, + { + "start": { + "line": 30, + "column": 5 + }, + "end": { + "line": 38, + "column": 1 + }, + "name": "toplevelFunction3", + "kind": "function", + "isStackFrame": true, + "variables": [], + "children": [] + }, + { + "start": { + "line": 40, + "column": 5 + }, + "end": { + "line": 48, + "column": 1 + }, + "name": "toplevelFunction4", + "kind": "function", + "isStackFrame": true, + "variables": [], + "children": [] + } + ] + } + } + ], + "ranges": [] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/single-root-original-scope.map b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map new file mode 100644 index 00000000000000..3b03b4ef6d0c86 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map @@ -0,0 +1,12 @@ +{ + "version": 3, + "file": "single-root-original-scope.js", + "sources": [ + "original_0.js" + ], + "mappings": "", + "names": [ + "global" + ], + "scopes": "BCAAA,CKA,ECAA,FK" +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden new file mode 100644 index 00000000000000..9516233dc5a911 --- /dev/null +++ b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden @@ -0,0 +1,43 @@ +{ + "file": "single-root-original-scope.js", + "mappings": [], + "sources": [ + { + "url": "original_0.js", + "content": null, + "ignored": false, + "scope": { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 10, + "column": 0 + }, + "name": null, + "kind": "global", + "isStackFrame": false, + "variables": [], + "children": [] + } + } + ], + "ranges": [ + { + "start": { + "line": 0, + "column": 0 + }, + "end": { + "line": 0, + "column": 10 + }, + "definitionIndex": 0, + "stackFrameType": "none", + "callSite": null, + "bindings": [], + "children": [] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/test426/decoding/source-map-record.d.ts b/test/fixtures/test426/decoding/source-map-record.d.ts new file mode 100644 index 00000000000000..902e5ee1565c88 --- /dev/null +++ b/test/fixtures/test426/decoding/source-map-record.d.ts @@ -0,0 +1,44 @@ +/** + * The global type of a .golden JSON. + */ +interface SourceMapRecord { + file: string|null; + sources: SourceRecord[]; + mappings: MappingRecord[]; +} + +/** + * Corresponds to a [Decoded Source Record](https://tc39.es/ecma426/#decoded-source-record) + */ +interface SourceRecord { + url: string|null; + content: string|null; + ignored: boolean; +} + +/** + * Corresponds to a [Decoded Mapping Record](https://tc39.es/ecma426/#decoded-mapping-record) + */ +interface MappingRecord { + generatedPosition: PositionRecord; + originalPosition: OriginalPositionRecord|null; + name: string|null; +} + +/** + * Corresponds to a [Position Record](https://tc39.es/ecma426/#sec-position-record-type) + */ +interface PositionRecord { + line: number; + column: number; +} + +/** + * Corresponds to a [Original Position Record](https://tc39.es/ecma426/#sec-original-position-record-type) + */ +interface OriginalPositionRecord { + /** An index into {@link SourceMapRecord.sources}. */ + sourceIndex: number; + line: number; + column: number; +} diff --git a/test/fixtures/test426/range-mappings-proposal-tests.json b/test/fixtures/test426/range-mappings-proposal-tests.json new file mode 100644 index 00000000000000..42d47d57650338 --- /dev/null +++ b/test/fixtures/test426/range-mappings-proposal-tests.json @@ -0,0 +1,203 @@ +{ + "resourceBasePath": "proposals/range-mappings", + "tests": [ + { + "name": "rangeMappingsWrongType1", + "description": "Test an invalid source map with a malformed rangeMappings field", + "baseFile": "wrong-type-1.js", + "sourceMapFile": "wrong-type-1.js.map", + "sourceMapIsValid": false + }, + { + "name": "rangeMappingsWrongType2", + "description": "Test an invalid source map with a malformed rangeMappings field", + "baseFile": "wrong-type-2.js", + "sourceMapFile": "wrong-type-2.js.map", + "sourceMapIsValid": false + }, + { + "name": "rangeMappingsWrongType3", + "description": "Test an invalid source map with a malformed rangeMappings field", + "baseFile": "wrong-type-3.js", + "sourceMapFile": "wrong-type-3.js.map", + "sourceMapIsValid": false + }, + { + "name": "rangeMappingsInvalidBase64Char1", + "description": "Test an invalid range mapping with an invalid base64 character", + "baseFile": "invalid-base64-char-1.js", + "sourceMapFile": "invalid-base64-char-1.js.map", + "sourceMapIsValid": false + }, + { + "name": "rangeMappingsInvalidBase64Char2", + "description": "Test an invalid range mapping with an invalid base64 character", + "baseFile": "invalid-base64-char-2.js", + "sourceMapFile": "invalid-base64-char-2.js.map", + "sourceMapIsValid": false + }, + { + "name": "rangeMappingsOutOfRange", + "description": "Test an invalid range mapping which is outside the mappings length", + "baseFile": "out-of-range.js", + "sourceMapFile": "out-of-range.js.map", + "sourceMapIsValid": false + }, + { + "name": "rangeMappingsOutOfRange2", + "description": "Test an invalid range mapping which has more lines than the normal mappings", + "baseFile": "out-of-range-2.js", + "sourceMapFile": "out-of-range-2.js.map", + "sourceMapIsValid": false + }, + { + "name": "rangeMappingsEmpty", + "description": "Test a trivial range mapping that is the empty string", + "baseFile": "empty-string.js", + "sourceMapFile": "empty-string.js.map", + "sourceMapIsValid": true + }, + { + "name": "rangeMappingsNonFullLineCoverage", + "description": "Test a non-empty range mapping where not all lines in the generated source are covered", + "baseFile": "non-full-line-coverage.js", + "sourceMapFile": "non-full-line-coverage.js.map", + "sourceMapIsValid": true + }, + { + "name": "rangeMappingsSimple", + "description": "Test a simple, single-entry rangeMappings", + "baseFile": "simple.js", + "sourceMapFile": "simple.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 1, + "originalSource": "simple-original.js", + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 2, + "originalSource": "simple-original.js", + "originalLine": 0, + "originalColumn": 1, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 3, + "originalSource": "simple-original.js", + "originalLine": 0, + "originalColumn": 2, + "mappedName": null + } + ] + }, + { + "name": "rangeMappingsMultipleMappings", + "description": "Test a case where multiple mappings are range mappings", + "baseFile": "multiple-mappings.js", + "sourceMapFile": "multiple-mappings.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 1, + "originalSource": "multiple-mappings-original.js", + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 2, + "originalSource": "multiple-mappings-original.js", + "originalLine": 0, + "originalColumn": 1, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 16, + "originalSource": "multiple-mappings-original.js", + "originalLine": 0, + "originalColumn": 16, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 18, + "originalSource": "multiple-mappings-original.js", + "originalLine": 0, + "originalColumn": 18, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 35, + "originalSource": "multiple-mappings-original.js", + "originalLine": 0, + "originalColumn": 36, + "mappedName": null + } + ] + }, + { + "name": "rangeMappingsNewline", + "description": "Test rangeMappings entry continues through newlines", + "baseFile": "newline-semantics.js", + "sourceMapFile": "newline-semantics.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 1, + "originalSource": "newline-semantics-original.js", + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 7, + "originalSource": "newline-semantics-original.js", + "originalLine": 0, + "originalColumn": 6, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 0, + "originalSource": "newline-semantics-original.js", + "originalLine": 1, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 1, + "generatedColumn": 2, + "originalSource": "newline-semantics-original.js", + "originalLine": 1, + "originalColumn": 2, + "mappedName": null + } + ] + } + ] +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/empty-string.js b/test/fixtures/test426/resources/proposals/range-mappings/empty-string.js new file mode 100644 index 00000000000000..cc932ea75eeb99 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/empty-string.js @@ -0,0 +1 @@ +//# sourceMappingURL=empty-string.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/empty-string.js.map b/test/fixtures/test426/resources/proposals/range-mappings/empty-string.js.map new file mode 100644 index 00000000000000..c113ba41c8d4e7 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/empty-string.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "empty-string.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "rangeMappings": "" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js new file mode 100644 index 00000000000000..2056842eb3800b --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-base64-char-1.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js.map b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js.map new file mode 100644 index 00000000000000..9590ff85402e90 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-1.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "invalid-base64-char-1.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "rangeMappings": "AB%" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js new file mode 100644 index 00000000000000..d81ed3a8417bbc --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-base64-char-2.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js.map b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js.map new file mode 100644 index 00000000000000..aa229b0bf15094 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/invalid-base64-char-2.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "invalid-base64-char-2.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "rangeMappings": "ab=" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js b/test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js new file mode 100644 index 00000000000000..b98843245bf481 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js @@ -0,0 +1,3 @@ + + "Hello world"; function f() { } +//# sourceMappingURL=multiple-mappings.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js.map b/test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js.map new file mode 100644 index 00000000000000..2fab6bd1977c25 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/multiple-mappings.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "names": [], + "sources": ["multiple-mappings-original.js"], + "sourcesContent": ["\"Hello World\"; function f() { } "], + "mappings": ";CAAA,aAAa,EAAG,iBAAoB;A", + "rangeMappings": ";AC;" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js b/test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js new file mode 100644 index 00000000000000..043e5eb4e4154f --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js @@ -0,0 +1,3 @@ + 1234 +5678 +//# sourceMappingURL=newline-semantics.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js.map b/test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js.map new file mode 100644 index 00000000000000..9f9e581b9edd17 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/newline-semantics.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "empty-string.js", + "sources": ["newline-semantics-original.js"], + "sourcesContent": ["1234\n5678"], + "mappings": "CAAA;GACG", + "rangeMappings": "A;" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js b/test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js new file mode 100644 index 00000000000000..d92450e4122118 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js @@ -0,0 +1,3 @@ + + "Hello world" +//# sourceMappingURL=non-full-line-coverage.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js.map b/test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js.map new file mode 100644 index 00000000000000..a381b123995747 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/non-full-line-coverage.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "empty-string.js", + "sources": ["simple-original.js"], + "sourcesContent": ["\"Hello World\""], + "mappings": ";CAAA;A", + "rangeMappings": ";A" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js new file mode 100644 index 00000000000000..e66dfab7bc38d2 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js @@ -0,0 +1,2 @@ +"foo" +//# sourceMappingURL=out-of-range-2.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js.map b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js.map new file mode 100644 index 00000000000000..152fd6653a8546 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range-2.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "out-of-range.js", + "sources": ["foo.js"], + "sourcesContent": ["\"foo\""], + "mappings": "AAA", + "rangeMappings": "B;A;A" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js new file mode 100644 index 00000000000000..d62ed10a903ef6 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js @@ -0,0 +1,2 @@ +"foo" +//# sourceMappingURL=out-of-range.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js.map b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js.map new file mode 100644 index 00000000000000..5ad9a234d91120 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/out-of-range.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "out-of-range.js", + "sources": ["foo.js"], + "sourcesContent": ["\"foo\""], + "mappings": "AAA", + "rangeMappings": "B" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/simple.js b/test/fixtures/test426/resources/proposals/range-mappings/simple.js new file mode 100644 index 00000000000000..fbd161b4f2beb4 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/simple.js @@ -0,0 +1,3 @@ + + "Hello world" +//# sourceMappingURL=simple.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/simple.js.map b/test/fixtures/test426/resources/proposals/range-mappings/simple.js.map new file mode 100644 index 00000000000000..0cd782bcee0638 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/simple.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "simple.js", + "sources": ["simple-original.js"], + "sourcesContent": ["\"Hello World\""], + "mappings": ";CAAA;A", + "rangeMappings": ";A;" +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js new file mode 100644 index 00000000000000..fe6c1a379904e9 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js @@ -0,0 +1 @@ +//# sourceMappingURL=wrong-type-1.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js.map b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js.map new file mode 100644 index 00000000000000..760c51d4a30d90 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-1.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "wrong-type-1.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "rangeMappings": 3 +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js new file mode 100644 index 00000000000000..57438ecec4c739 --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js @@ -0,0 +1 @@ +//# sourceMappingURL=wrong-type-2.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js.map b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js.map new file mode 100644 index 00000000000000..4a138c274623ac --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-2.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "wrong-type-2.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "rangeMappings": { "x": "foo" } +} diff --git a/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js new file mode 100644 index 00000000000000..d94d49a642974a --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js @@ -0,0 +1 @@ +//# sourceMappingURL=wrong-type-3.js.map diff --git a/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js.map b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js.map new file mode 100644 index 00000000000000..2d8bdb163d49fd --- /dev/null +++ b/test/fixtures/test426/resources/proposals/range-mappings/wrong-type-3.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "names": [], + "file": "wrong-type-3.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "rangeMappings": ["foo"] +} diff --git a/test/fixtures/test426/source-map-spec-tests.json b/test/fixtures/test426/source-map-spec-tests.json index bf3dc64ba5b9c9..602ba8dbd7270a 100644 --- a/test/fixtures/test426/source-map-spec-tests.json +++ b/test/fixtures/test426/source-map-spec-tests.json @@ -101,7 +101,7 @@ { "name": "sourcesContentNotStringOrNull", "description": "Test a source map with a sourcesContent list that has non-string and non-null items", - "baseFile": "sources-not-string-or-null.js", + "baseFile": "sources-content-not-string-or-null.js", "sourceMapFile": "sources-content-not-string-or-null.js.map", "sourceMapIsValid": false }, diff --git a/test/test426/README.md b/test/test426/README.md index edf4b3a95b8e96..58b499920f7087 100644 --- a/test/test426/README.md +++ b/test/test426/README.md @@ -7,7 +7,7 @@ suite ensures that the Node.js source map implementation conforms to the The [`test/fixtures/test426`](../fixtures/test426/) contains a copy of the set of [Source Map Tests][] suite. The last updated hash is: -* +* See the json files in [the `status` folder](./status) for prerequisites, expected failures, and support status for specific tests.