diff --git a/README.md b/README.md index 962b65d..5ac28c5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Source Map Tests -This repository holds testing discussions for the the Source Map debugging format. Specifically, we're looking to encourage discussion around: +This repository holds testing discussions and tests for the 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 @@ -9,3 +9,151 @@ This repository holds testing discussions for the the Source Map debugging forma Open discussion happens in the [GitHub issues](https://github.com/source-map/source-map-tests/issues). Source Map spec: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + +## Test cases + +These test cases are still a work-in-progress 🚧. + +#### Running the tests + +How to run in WebKit: + * Check out [WebKit](https://github.com/WebKit/WebKit/) + * `cd` to the checked out WebKit directory. + * Run `git am /webkit/0001-Add-harness-for-source-maps-spec-tests.patch` + * Run `Tools/Scripts/build-webkit` (depending on the platform you may need to pass `--gtk` or other flags) + * Run `Tools/Scripts/run-webkit-tests LayoutTests/inspector/model/source-map-spec.html` (again, you may need `--gtk` on Linux) + +For Firefox, see the Mozilla [source-map](https://github.com/mozilla/source-map) library: + * There is a [branch](https://github.com/takikawa/source-map/tree/add-spec-tests) for adding the spec tests to the package. + +### Goals of tests + +* Thoroughly test all aspects of the source maps spec that can be tested. +* Strictly follow the spec when determining test behavior. + +### Test coverage + +#### Core spec + +* Encoding + - [ ] Source map must be a valid JSON document. + - Base64 VLQ + * VLQs should decode correctly + - [X] A VLQ with a non-base64 character will fail to decode. + - [ ] A VLQ with one digit and no continuation digits should decode. + - [ ] A negative VLQ with the sign bit set to 1 should decode. + - [ ] A VLQ with non-zero continuation bits (and more than one digit) should decode. + - [X] A VLQ with a non-zero continuation bit with no further digits should fail to decode. + - [ ] A VLQ should decode with the correct order of digits (least to most significant). + - [x] A long VLQ with many trailing zero digits will decode. + * [x] A VLQ exceeding the 32-bit size limit is invalid (note: the spec is unclear on the details of this limit) + * [x] A VLQ at exactly the 32-bit size limit should be decoded (positive and negative). +* Basic format + - `version` field + * [X] Must be present + * [X] Must be a number + * [X] Must be 3 + - `file` field + * [ ] Optional, allow missing + * [ ] Must be a string? (spec is not clear) + - `sourceRoot` field + * [ ] Optional, allow missing + * [ ] Must be a string? (spec is not clear) + - `sources` field + * [X] Must be present + * [X] Must be an array + * [X] Array elements must be `null` or a string + - `sourcesContent` field + * [X] Must be present + * [X] Must be an array + * [X] Array elements must be `null` or a string + - `names` field + * [X] Must be present (note: the spec implies this but implementations may not agree) + * [X] Must be an array + * [X] Array elements must be strings + - `mappings` field + * [X] Must be present + * [X] Must be a string + * [ ] Empty string is valid + - `ignoreList` field + * [ ] Optional, allow missing + * [ ] Must be an array + * [ ] Array elements must be numbers + * [ ] Elements must not be out of bounds for the `sources` list + - [X] Extra unrecognized fields are allowed +* Index maps + - ? Must be mutually exclusive with non-index map? + - `file` field + * [ ] Optional, allow missing + * [ ] Must be a string? (spec is not clear) + - `sections` field + * [X] Must be present + * [X] Must be an array + * [ ] An empty sections array is valid + * [X] Array elements are valid section objects + - `offset` field + * [X] Must be present + * `line` field + - [X] Must be present + - [X] Must be a number + * `column` field + - [X] Must be present + - [X] Must be a number + - `map` field + * [X] Must be present + * [X] Must be an object + * [ ] Must be a valid source map + - [X] Sections are in order (the spec is not 100% clear, but assumption is increasing numeric order, may need subtests) + - [X] Sections are non-overlapping (the definition of overlap is not clear, may need subtests) +* Mappings format + - [X] Each line is separated by ";" + - [X] A line may consist of zero segments (e.g., ";;") + - [X] Each line consists only of segments separated by "," + - [X] Must have greater than zero fields (note: many implementations don't check) + - [X] Must have 1, 4, or 5 fields + - [X] The source index must not be out of bounds of the sources array + - [X] The name index must not be out of bounds of the names array + - Absolute VLQ values must be non-negative + * [X] The column must be non-negative + * [X] The source index must be non-negative + * [X] The original line must be non-negative + * [X] The original column must be non-negative + * [X] The name index must be non-negative + - Relative VLQ values must be non-negative after adding to previous value + * [X] The column must be non-negative + * [X] The source index must be non-negative + * [X] The original line must be non-negative + * [X] The original column must be non-negative + * [X] The name index must be non-negative +* Ignore list + - [X] An ignore list is optional, may be missing + - [X] An ignore list can't be a non-array value + * [X] An ignore list can be empty + * [X] An ignore list entry must be a number + * [X] An ignore list entry cannot be out-of-bounds of the sources array + - [X] Ignore list entries are detected and are present + - [X] Items not specified in the ignore list don't show up as ignored +* Mappings semantics + - [ ] A source map with no mappings does not map any position. + - [ ] A single field segment gets mapped to the correct line and column. + - [X] A four field segment gets mapped to the correct line and column. + - [X] A five field segment gets mapped to the correct line and column. + - [X] When a name is present in a segment, it is correctly mapped. + - [X] When a source is present in a segment, it is correctly mapped. + - [ ] The second occurence of a field segment in a line is mapped relative to the previous one. + - [ ] When a new line starts, the generated column field resets to zero rather than being relative to the previous line. + - [ ] For fields other than the generated column, a segment field that has occured once in a previous line is mapped relatively when it occurs in the next line. + - [ ] Ensure that a transitive source map mapping works as expected + - Index maps are correctly used in mappings + * [ ] An index map with one sub-map will map correctly. + * [X] An index map with multiple sub-maps will map correctly, with appropriate offsets for the second and later sub-maps. +* Resolution of sources + - [ ] When `sourceRoot` is provided, it is prepended to any `sources` entries and will be mapped with the full URL. + - [ ] If the source URL is an absolute URL, it is resolved as an absolute URL. + - [ ] If the source URL is a relative URL, it is resolved relative to the source map path. +* Wasm support + - [ ] Create versions of the tests that use a Wasm source. + +### Scopes Proposal + +TODO diff --git a/chrome/0001-add-tests-for-sourcemaps-spec.patch b/chrome/0001-add-tests-for-sourcemaps-spec.patch new file mode 100644 index 0000000..18e82a1 --- /dev/null +++ b/chrome/0001-add-tests-for-sourcemaps-spec.patch @@ -0,0 +1,2070 @@ +From 5a77ff79e4092740116e1c6871bd15fc5f560e66 Mon Sep 17 00:00:00 2001 +From: Agata Belkius +Date: Fri, 19 Apr 2024 15:30:48 +0100 +Subject: [PATCH 1/3] add tests for sourcemaps spec + +--- + front_end/BUILD.gn | 1 + + front_end/core/sdk/BUILD.gn | 1 + + front_end/core/sdk/SourceMapSpec.test.ts | 129 ++++ + .../core/sdk/fixtures/sourcemaps/BUILD.gn | 106 ++++ + .../sourcemaps/basic-mapping-as-index-map.js | 2 + + .../basic-mapping-as-index-map.js.map | 23 + + .../sourcemaps/basic-mapping-original.js | 8 + + .../sdk/fixtures/sourcemaps/basic-mapping.js | 2 + + .../fixtures/sourcemaps/basic-mapping.js.map | 6 + + .../index-map-invalid-base-mappings.js | 1 + + .../index-map-invalid-base-mappings.js.map | 15 + + .../sourcemaps/index-map-invalid-overlap.js | 1 + + .../index-map-invalid-overlap.js.map | 23 + + .../index-map-missing-offset-column.js | 1 + + .../index-map-missing-offset-column.js.map | 14 + + .../index-map-missing-offset-line.js | 1 + + .../index-map-missing-offset-line.js.map | 14 + + .../sourcemaps/index-map-missing-offset.js | 1 + + .../index-map-missing-offset.js.map | 13 + + .../index-map-offset-column-wrong-type.js | 1 + + .../index-map-offset-column-wrong-type.js.map | 14 + + .../index-map-offset-line-wrong-type.js | 1 + + .../index-map-offset-line-wrong-type.js.map | 14 + + .../invalid-mapping-bad-separator.js | 2 + + .../invalid-mapping-bad-separator.js.map | 6 + + .../invalid-mapping-not-a-string-1.js | 1 + + .../invalid-mapping-not-a-string-1.js.map | 7 + + .../invalid-mapping-not-a-string-2.js | 1 + + .../invalid-mapping-not-a-string-2.js.map | 7 + + ...nvalid-mapping-segment-column-too-large.js | 1 + + ...id-mapping-segment-column-too-large.js.map | 7 + + ...apping-segment-name-index-out-of-bounds.js | 1 + + ...ng-segment-name-index-out-of-bounds.js.map | 7 + + ...id-mapping-segment-name-index-too-large.js | 1 + + ...apping-segment-name-index-too-large.js.map | 7 + + ...invalid-mapping-segment-negative-column.js | 1 + + ...lid-mapping-segment-negative-column.js.map | 7 + + ...lid-mapping-segment-negative-name-index.js | 1 + + ...mapping-segment-negative-name-index.js.map | 7 + + ...apping-segment-negative-original-column.js | 1 + + ...ng-segment-negative-original-column.js.map | 7 + + ...-mapping-segment-negative-original-line.js | 1 + + ...ping-segment-negative-original-line.js.map | 7 + + ...d-mapping-segment-negative-source-index.js | 1 + + ...pping-segment-negative-source-index.js.map | 7 + + ...pping-segment-original-column-too-large.js | 1 + + ...g-segment-original-column-too-large.js.map | 7 + + ...mapping-segment-original-line-too-large.js | 1 + + ...ing-segment-original-line-too-large.js.map | 7 + + ...ping-segment-source-index-out-of-bounds.js | 1 + + ...-segment-source-index-out-of-bounds.js.map | 7 + + ...-mapping-segment-source-index-too-large.js | 1 + + ...ping-segment-source-index-too-large.js.map | 7 + + ...valid-mapping-segment-with-three-fields.js | 2 + + ...d-mapping-segment-with-three-fields.js.map | 6 + + ...invalid-mapping-segment-with-two-fields.js | 2 + + ...lid-mapping-segment-with-two-fields.js.map | 6 + + ...nvalid-mapping-segment-with-zero-fields.js | 1 + + ...id-mapping-segment-with-zero-fields.js.map | 7 + + .../sourcemaps/invalid-vlq-non-base64-char.js | 1 + + .../invalid-vlq-non-base64-char.js.map | 6 + + .../sdk/fixtures/sourcemaps/names-missing.js | 1 + + .../fixtures/sourcemaps/names-missing.js.map | 5 + + .../fixtures/sourcemaps/names-not-a-list-1.js | 1 + + .../sourcemaps/names-not-a-list-1.js.map | 6 + + .../fixtures/sourcemaps/names-not-a-list-2.js | 1 + + .../sourcemaps/names-not-a-list-2.js.map | 6 + + .../fixtures/sourcemaps/names-not-string.js | 1 + + .../sourcemaps/names-not-string.js.map | 6 + + .../sourcemaps/source-map-spec-tests.json | 573 ++++++++++++++++++ + .../fixtures/sourcemaps/sources-missing.js | 1 + + .../sourcemaps/sources-missing.js.map | 5 + + .../sourcemaps/sources-not-a-list-1.js | 1 + + .../sourcemaps/sources-not-a-list-1.js.map | 6 + + .../sourcemaps/sources-not-a-list-2.js | 1 + + .../sourcemaps/sources-not-a-list-2.js.map | 6 + + .../sourcemaps/sources-not-string-or-null.js | 1 + + .../sources-not-string-or-null.js.map | 6 + + .../sourcemaps/unrecognized-property.js | 1 + + .../sourcemaps/unrecognized-property.js.map | 8 + + .../valid-mapping-boundary-values.js | 1 + + .../valid-mapping-boundary-values.js.map | 7 + + .../sourcemaps/valid-mapping-empty-groups.js | 1 + + .../valid-mapping-empty-groups.js.map | 7 + + .../sourcemaps/valid-mapping-large-vlq.js | 1 + + .../sourcemaps/valid-mapping-large-vlq.js.map | 6 + + .../sourcemaps/valid-mapping-null-sources.js | 2 + + .../valid-mapping-null-sources.js.map | 6 + + .../fixtures/sourcemaps/version-missing.js | 1 + + .../sourcemaps/version-missing.js.map | 5 + + .../sourcemaps/version-not-a-number.js | 1 + + .../sourcemaps/version-not-a-number.js.map | 6 + + .../sourcemaps/version-numeric-string.js | 1 + + .../sourcemaps/version-numeric-string.js.map | 6 + + .../fixtures/sourcemaps/version-too-high.js | 1 + + .../sourcemaps/version-too-high.js.map | 6 + + .../fixtures/sourcemaps/version-too-low.js | 1 + + .../sourcemaps/version-too-low.js.map | 6 + + .../sdk/fixtures/sourcemaps/version-valid.js | 1 + + .../fixtures/sourcemaps/version-valid.js.map | 6 + + 100 files changed, 1251 insertions(+) + create mode 100644 front_end/core/sdk/SourceMapSpec.test.ts + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/BUILD.gn + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/basic-mapping-original.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-missing.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-missing.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-not-string.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/names-not-string.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/source-map-spec-tests.json + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-missing.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-missing.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-missing.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-missing.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-too-high.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-too-high.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-too-low.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-too-low.js.map + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-valid.js + create mode 100644 front_end/core/sdk/fixtures/sourcemaps/version-valid.js.map + +diff --git a/front_end/BUILD.gn b/front_end/BUILD.gn +index 85926fd08b..0dc146898c 100644 +--- a/front_end/BUILD.gn ++++ b/front_end/BUILD.gn +@@ -106,6 +106,7 @@ group("unittests") { + "core/protocol_client:unittests", + "core/root:unittests", + "core/sdk:unittests", ++ "core/sdk/fixtures/sourcemaps", + "entrypoints/formatter_worker:unittests", + "entrypoints/heap_snapshot_worker:unittests", + "entrypoints/inspector_main:unittests", +diff --git a/front_end/core/sdk/BUILD.gn b/front_end/core/sdk/BUILD.gn +index 43ea1be19c..bdc88a7e04 100644 +--- a/front_end/core/sdk/BUILD.gn ++++ b/front_end/core/sdk/BUILD.gn +@@ -163,6 +163,7 @@ ts_library("unittests") { + "SourceMap.test.ts", + "SourceMapManager.test.ts", + "SourceMapScopes.test.ts", ++ "SourceMapSpec.test.ts", + "StorageBucketsModel.test.ts", + "StorageKeyManager.test.ts", + "Target.test.ts", +diff --git a/front_end/core/sdk/SourceMapSpec.test.ts b/front_end/core/sdk/SourceMapSpec.test.ts +new file mode 100644 +index 0000000000..64f350d7f3 +--- /dev/null ++++ b/front_end/core/sdk/SourceMapSpec.test.ts +@@ -0,0 +1,129 @@ ++// Copyright 2024 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++ ++/** ++ This file tests if devtools sourcemaps implementation is matching the sourcemaps spec. ++ Sourcemap Spec tests are using test data coming from: https://github.com/takikawa/source-map-tests ++ ++ At the moment only basic mapping tests are implemented. Expected results: ++ ++ ==== FAIL: SourceMapSpec/checks mappings for valid-mapping-null-sources.js.map ++ AssertionError: unexpected source URL: expected 'null' to equal null ++ at front_end/core/sdk/SourceMapSpec.test.ts:74:20 <- out/Default/gen/front_end/core/sdk/SourceMapSpec.test.js:25:32 ++ at Array.forEach () ++ at Context. (front_end/core/sdk/SourceMapSpec.test.ts:62:21 <- out/Default/gen/front_end/core/sdk/SourceMapSpec.test.js:21:29) ++ ++ - expected ++ + actual ++ ++ -[null] ++ +"null" ++ ============================================================================== ++ ++ FAILED: 1 failed, 46 passed (0 skipped) ++ ERRORS DETECTED ++ ++ **/ ++ ++const {assert} = chai; ++import type * as Platform from '../platform/platform.js'; ++import {assertNotNullOrUndefined} from '../platform/platform.js'; ++import { SourceMapV3 } from './SourceMap.js'; ++import * as SDK from './sdk.js'; ++import {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js'; ++ ++interface TestSpec { ++ name: string; ++ description: string; ++ baseFile: string; ++ sourceMapFile: string; ++ sourceMapIsValid: boolean; ++ testActions?: TestAction[]; ++} ++ ++interface TestAction { ++ actionType: string; ++ generatedLine: number; ++ generatedColumn: number; ++ originalSource: string; ++ originalLine: number; ++ originalColumn: number; ++ mappedName: null | string; ++} ++ ++const testCases = await loadTestCasesFromFixture('source-map-spec-tests.json'); ++ ++describeWithEnvironment.only('SourceMapSpec', async () => { ++ testCases.forEach(async ({ ++ baseFile, ++ sourceMapFile, ++ testActions, ++ sourceMapIsValid ++ }) => { ++ it(`checks mappings for ${sourceMapFile}`, async () => { ++ if (!sourceMapIsValid) { ++ return; ++ } ++ ++ const baseFileUrl = baseFile as Platform.DevToolsPath.UrlString; ++ const sourceMapFileUrl = sourceMapFile as Platform.DevToolsPath.UrlString; ++ const sourceMapContent = await loadSourceMapFromFixture(sourceMapFile); ++ ++ const sourceMap = new SDK.SourceMap.SourceMap( ++ baseFileUrl, ++ sourceMapFileUrl, ++ sourceMapContent); ++ ++ ++ if (testActions !== undefined) { ++ testActions.forEach(({ ++ actionType, ++ originalSource, ++ originalLine, ++ originalColumn, ++ generatedLine, ++ generatedColumn ++ }) => { ++ if (actionType === "checkMapping" && sourceMapIsValid) { ++ const actual = sourceMap.findEntry(generatedLine, generatedColumn); ++ assertNotNullOrUndefined(actual); ++ ++ assert.strictEqual(actual.sourceURL, originalSource, 'unexpected source URL'); ++ assert.strictEqual(actual.sourceLineNumber, originalLine, 'unexpected source line number'); ++ assert.strictEqual(actual.sourceColumnNumber, originalColumn, 'unexpected source column number'); ++ } ++ }); ++ } ++ }); ++ }); ++}); ++ ++async function loadTestCasesFromFixture(filename: string): Promise { ++ const testSpec = await getFixtureFileContents<{ tests: TestSpec[] }>(filename); ++ return testSpec?.tests ?? []; ++}; ++ ++async function loadSourceMapFromFixture(filename: string): Promise { ++ return getFixtureFileContents(filename); ++}; ++ ++async function getFixtureFileContents(filename: string): ++ Promise { ++ const url = new URL(`/front_end/core/sdk/fixtures/sourcemaps/${filename}`, window.location.origin); ++ ++ const response = await fetch(url); ++ ++ if (response.status !== 200) { ++ throw new Error(`Unable to load ${url}`); ++ } ++ ++ const contentType = response.headers.get('content-type'); ++ const isGzipEncoded = contentType !== null && contentType.includes('gzip'); ++ let buffer = await response.arrayBuffer(); ++ ++ const decoder = new TextDecoder('utf-8'); ++ const contents = JSON.parse(decoder.decode(buffer)) as T; ++ return contents; ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/BUILD.gn b/front_end/core/sdk/fixtures/sourcemaps/BUILD.gn +new file mode 100644 +index 0000000000..f39bf7afc6 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/BUILD.gn +@@ -0,0 +1,106 @@ ++# Copyright 2022 The Chromium Authors. All rights reserved. ++# Use of this source code is governed by a BSD-style license that can be ++# found in the LICENSE file. ++ ++import("../../../../../scripts/build/ninja/copy.gni") ++ ++copy_to_gen("sourcemaps") { ++ sources = [ ++ "basic-mapping-as-index-map.js", ++ "basic-mapping-as-index-map.js.map", ++ "basic-mapping-original.js", ++ "basic-mapping.js", ++ "basic-mapping.js.map", ++ "index-map-invalid-base-mappings.js", ++ "index-map-invalid-base-mappings.js.map", ++ "index-map-invalid-overlap.js", ++ "index-map-invalid-overlap.js.map", ++ "index-map-missing-offset-column.js", ++ "index-map-missing-offset-column.js.map", ++ "index-map-missing-offset-line.js", ++ "index-map-missing-offset-line.js.map", ++ "index-map-missing-offset.js", ++ "index-map-missing-offset.js.map", ++ "index-map-offset-column-wrong-type.js", ++ "index-map-offset-column-wrong-type.js.map", ++ "index-map-offset-line-wrong-type.js", ++ "index-map-offset-line-wrong-type.js.map", ++ "invalid-mapping-bad-separator.js", ++ "invalid-mapping-bad-separator.js.map", ++ "invalid-mapping-not-a-string-1.js", ++ "invalid-mapping-not-a-string-1.js.map", ++ "invalid-mapping-not-a-string-2.js", ++ "invalid-mapping-not-a-string-2.js.map", ++ "invalid-mapping-segment-column-too-large.js", ++ "invalid-mapping-segment-column-too-large.js.map", ++ "invalid-mapping-segment-name-index-out-of-bounds.js", ++ "invalid-mapping-segment-name-index-out-of-bounds.js.map", ++ "invalid-mapping-segment-name-index-too-large.js", ++ "invalid-mapping-segment-name-index-too-large.js.map", ++ "invalid-mapping-segment-negative-column.js", ++ "invalid-mapping-segment-negative-column.js.map", ++ "invalid-mapping-segment-negative-name-index.js", ++ "invalid-mapping-segment-negative-name-index.js.map", ++ "invalid-mapping-segment-negative-original-column.js", ++ "invalid-mapping-segment-negative-original-column.js.map", ++ "invalid-mapping-segment-negative-original-line.js", ++ "invalid-mapping-segment-negative-original-line.js.map", ++ "invalid-mapping-segment-negative-source-index.js", ++ "invalid-mapping-segment-negative-source-index.js.map", ++ "invalid-mapping-segment-original-column-too-large.js", ++ "invalid-mapping-segment-original-column-too-large.js.map", ++ "invalid-mapping-segment-original-line-too-large.js", ++ "invalid-mapping-segment-original-line-too-large.js.map", ++ "invalid-mapping-segment-source-index-out-of-bounds.js", ++ "invalid-mapping-segment-source-index-out-of-bounds.js.map", ++ "invalid-mapping-segment-source-index-too-large.js", ++ "invalid-mapping-segment-source-index-too-large.js.map", ++ "invalid-mapping-segment-with-three-fields.js", ++ "invalid-mapping-segment-with-three-fields.js.map", ++ "invalid-mapping-segment-with-two-fields.js", ++ "invalid-mapping-segment-with-two-fields.js.map", ++ "invalid-mapping-segment-with-zero-fields.js", ++ "invalid-mapping-segment-with-zero-fields.js.map", ++ "invalid-vlq-non-base64-char.js", ++ "invalid-vlq-non-base64-char.js.map", ++ "names-missing.js", ++ "names-missing.js.map", ++ "names-not-a-list-1.js", ++ "names-not-a-list-1.js.map", ++ "names-not-a-list-2.js", ++ "names-not-a-list-2.js.map", ++ "names-not-string.js", ++ "names-not-string.js.map", ++ "source-map-spec-tests.json", ++ "sources-missing.js", ++ "sources-missing.js.map", ++ "sources-not-a-list-1.js", ++ "sources-not-a-list-1.js.map", ++ "sources-not-a-list-2.js", ++ "sources-not-a-list-2.js.map", ++ "sources-not-string-or-null.js", ++ "sources-not-string-or-null.js.map", ++ "unrecognized-property.js", ++ "unrecognized-property.js.map", ++ "valid-mapping-boundary-values.js", ++ "valid-mapping-boundary-values.js.map", ++ "valid-mapping-empty-groups.js", ++ "valid-mapping-empty-groups.js.map", ++ "valid-mapping-large-vlq.js", ++ "valid-mapping-large-vlq.js.map", ++ "valid-mapping-null-sources.js", ++ "valid-mapping-null-sources.js.map", ++ "version-missing.js", ++ "version-missing.js.map", ++ "version-not-a-number.js", ++ "version-not-a-number.js.map", ++ "version-numeric-string.js", ++ "version-numeric-string.js.map", ++ "version-too-high.js", ++ "version-too-high.js.map", ++ "version-too-low.js", ++ "version-too-low.js.map", ++ "version-valid.js", ++ "version-valid.js.map", ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js +new file mode 100644 +index 0000000000..b9fae38043 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=basic-mapping-as-index-map.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js.map b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js.map +new file mode 100644 +index 0000000000..0863d44e62 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-as-index-map.js.map +@@ -0,0 +1,23 @@ ++{ ++ "version": 3, ++ "sections": [ ++ { ++ "offset": { "line": 0, "column": 0 }, ++ "map": { ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAAA,SAASA,MACP,OAAO,EACT,CACA" ++ } ++ }, ++ { ++ "offset": { "line": 0, "column": 34 }, ++ "map": { ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAGSC,MACP,OAAO,EACT,CACAD,MACAC" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-original.js b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-original.js +new file mode 100644 +index 0000000000..301b186cb1 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping-original.js +@@ -0,0 +1,8 @@ ++function foo() { ++ return 42; ++} ++function bar() { ++ return 24; ++} ++foo(); ++bar(); +diff --git a/front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js +new file mode 100644 +index 0000000000..2e479a4175 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=basic-mapping.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js.map b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js.map +new file mode 100644 +index 0000000000..12dc9679a4 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/basic-mapping.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version":3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings":"AAAA,SAASA,MACP,OAAO,EACT,CACA,SAASC,MACP,OAAO,EACT,CACAD,MACAC" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js +new file mode 100644 +index 0000000000..e90bef083c +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=index-map-invalid-base-mappings.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js.map b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js.map +new file mode 100644 +index 0000000000..b489c1f080 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-base-mappings.js.map +@@ -0,0 +1,15 @@ ++{ ++ "version": 3, ++ "mappings": "AAAA", ++ "sections": [ ++ { ++ "offset": { "line": 0, "column": 0 }, ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js +new file mode 100644 +index 0000000000..9aff8dc620 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=index-map-invalid-overlap.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js.map b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js.map +new file mode 100644 +index 0000000000..8d42546fd8 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-invalid-overlap.js.map +@@ -0,0 +1,23 @@ ++{ ++ "version": 3, ++ "sections": [ ++ { ++ "offset": { "line": 0, "column": 0 }, ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ }, ++ { ++ "offset": { "line": 0, "column": 0 }, ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js +new file mode 100644 +index 0000000000..fe6917403f +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=index-map-missing-offset-column.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js.map b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js.map +new file mode 100644 +index 0000000000..aa48bbb993 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-column.js.map +@@ -0,0 +1,14 @@ ++{ ++ "version": 3, ++ "sections": [ ++ { ++ "offset": { "line": 0 }, ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js +new file mode 100644 +index 0000000000..ba8614e412 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=index-map-missing-offset-line.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js.map b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js.map +new file mode 100644 +index 0000000000..3d60444ea7 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset-line.js.map +@@ -0,0 +1,14 @@ ++{ ++ "version": 3, ++ "sections": [ ++ { ++ "offset": { "column": 0 }, ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js +new file mode 100644 +index 0000000000..9ca2cf3fb5 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=index-map-missing-offset.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js.map b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js.map +new file mode 100644 +index 0000000000..7285138bf5 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-missing-offset.js.map +@@ -0,0 +1,13 @@ ++{ ++ "version": 3, ++ "sections": [ ++ { ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js +new file mode 100644 +index 0000000000..ed1e9ec5d5 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=index-map-offset-column-wrong-type.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js.map b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js.map +new file mode 100644 +index 0000000000..b43e79a9dd +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-column-wrong-type.js.map +@@ -0,0 +1,14 @@ ++{ ++ "version": 3, ++ "sections": [ ++ { ++ "offset": { "line": 0, "column": true }, ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js +new file mode 100644 +index 0000000000..d58f2aff99 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=index-map-offset-line-wrong-type.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js.map b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js.map +new file mode 100644 +index 0000000000..81dbcd6ec4 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/index-map-offset-line-wrong-type.js.map +@@ -0,0 +1,14 @@ ++{ ++ "version": 3, ++ "sections": [ ++ { ++ "offset": { "line": true, "column": 0 }, ++ "map": { ++ "version": 3, ++ "names": [], ++ "sources": ["empty-original.js"], ++ "mappings": "AAAA" ++ } ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js +new file mode 100644 +index 0000000000..25338aca30 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=invalid-mapping-bad-separator.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js.map +new file mode 100644 +index 0000000000..5f4f5b9233 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-bad-separator.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAAA.SAASA:MACP" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js +new file mode 100644 +index 0000000000..cb38e2fe9d +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-not-a-string-1.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js.map +new file mode 100644 +index 0000000000..5bf3e2a9d8 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-1.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-not-a-string-1.js", ++ "sources": ["empty-original.js"], ++ "mappings": 5 ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js +new file mode 100644 +index 0000000000..3d84abd6c6 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-not-a-string-2.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js.map +new file mode 100644 +index 0000000000..4527e7f764 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-not-a-string-2.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-not-a-string-2.js", ++ "sources": ["empty-original.js"], ++ "mappings": [1, 2, 3, 4] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js +new file mode 100644 +index 0000000000..55591f874b +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-column-too-large.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js.map +new file mode 100644 +index 0000000000..b4c059e015 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-column-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-column-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "ggggggE" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js +new file mode 100644 +index 0000000000..2a6b434eff +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-name-index-out-of-bounds.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js.map +new file mode 100644 +index 0000000000..8dd2ea6c2d +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-out-of-bounds.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": ["foo"], ++ "file": "invalid-mapping-segment-name-index-out-of-bounds.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAAC" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js +new file mode 100644 +index 0000000000..709e34dbd3 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-name-index-too-large.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js.map +new file mode 100644 +index 0000000000..c7bf5b98d1 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-name-index-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-name-index-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAAggggggE" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js +new file mode 100644 +index 0000000000..a202152d6f +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-column.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js.map +new file mode 100644 +index 0000000000..403878bfa4 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-column.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-column.js", ++ "sources": ["empty-original.js"], ++ "mappings": "F" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js +new file mode 100644 +index 0000000000..3e3f634204 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-name-index.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js.map +new file mode 100644 +index 0000000000..b94f63646e +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-name-index.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-name-index.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAAF" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js +new file mode 100644 +index 0000000000..f21d5342b3 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-original-column.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js.map +new file mode 100644 +index 0000000000..011c639d3f +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-column.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-original-column.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAF" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js +new file mode 100644 +index 0000000000..b37309601c +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-original-line.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js.map +new file mode 100644 +index 0000000000..e7ec993eeb +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-original-line.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-original-line.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAFA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js +new file mode 100644 +index 0000000000..6e05849b6a +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-source-index.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js.map +new file mode 100644 +index 0000000000..596c2f298b +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-negative-source-index.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-source-index.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AFAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js +new file mode 100644 +index 0000000000..0936ed7ea8 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-original-column-too-large.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js.map +new file mode 100644 +index 0000000000..ff2103fe24 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-column-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-original-column-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAggggggE" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js +new file mode 100644 +index 0000000000..9b3aa5a361 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-original-line-too-large.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js.map +new file mode 100644 +index 0000000000..890f1c71fc +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-original-line-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-original-line-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAggggggEA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js +new file mode 100644 +index 0000000000..2e5fbca268 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-source-index-out-of-bounds.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js.map +new file mode 100644 +index 0000000000..86dedb114f +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-out-of-bounds.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-source-index-out-of-bounds.js", ++ "sources": ["empty-original.js"], ++ "mappings": "ACAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js +new file mode 100644 +index 0000000000..3f4943e127 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-source-index-too-large.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js.map +new file mode 100644 +index 0000000000..e9f858c6e1 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-source-index-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-source-index-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AggggggEAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js +new file mode 100644 +index 0000000000..4b868fac9c +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=invalid-mapping-three-fields.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js.map +new file mode 100644 +index 0000000000..c2af1165ad +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-three-fields.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js +new file mode 100644 +index 0000000000..96045a7a11 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=invalid-mapping-two-fields.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js.map +new file mode 100644 +index 0000000000..73cf00fa1c +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-two-fields.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js +new file mode 100644 +index 0000000000..9d5332a56c +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-column-with-zero-fields.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js.map +new file mode 100644 +index 0000000000..5a34d25b64 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-mapping-segment-with-zero-fields.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-with-zero-fields.js", ++ "sources": ["empty-original.js"], ++ "mappings": ",,,," ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js b/front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js +new file mode 100644 +index 0000000000..d1b20b41a2 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-vlq-non-base64-char.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js.map b/front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js.map +new file mode 100644 +index 0000000000..4fa1ac5768 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/invalid-vlq-non-base64-char.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "A$%?!" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-missing.js b/front_end/core/sdk/fixtures/sourcemaps/names-missing.js +new file mode 100644 +index 0000000000..58781fd887 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-missing.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=names-missing.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-missing.js.map b/front_end/core/sdk/fixtures/sourcemaps/names-missing.js.map +new file mode 100644 +index 0000000000..82170bf784 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-missing.js.map +@@ -0,0 +1,5 @@ ++{ ++ "version" : 3, ++ "sources": ["empty-original.js"], ++ "mappings": "" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js +new file mode 100644 +index 0000000000..dc65f1972b +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=names-not-a-list-1.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js.map b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js.map +new file mode 100644 +index 0000000000..fe1edaeb96 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-1.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": ["source.js"], ++ "names": "not a list", ++ "mappings": "AAAAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js +new file mode 100644 +index 0000000000..d7251f78da +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=names-not-a-list-2.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js.map b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js.map +new file mode 100644 +index 0000000000..3388d2bb71 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-not-a-list-2.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": ["source.js"], ++ "names": { "foo": 3 }, ++ "mappings": "AAAAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-not-string.js b/front_end/core/sdk/fixtures/sourcemaps/names-not-string.js +new file mode 100644 +index 0000000000..8dc7b4811a +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-not-string.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=names-not-string.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/names-not-string.js.map b/front_end/core/sdk/fixtures/sourcemaps/names-not-string.js.map +new file mode 100644 +index 0000000000..c0feb0739a +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/names-not-string.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": ["source.js"], ++ "names": [null, 3, true, false, {}, []], ++ "mappings": "AAAAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/source-map-spec-tests.json b/front_end/core/sdk/fixtures/sourcemaps/source-map-spec-tests.json +new file mode 100644 +index 0000000000..7e7350b28e +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/source-map-spec-tests.json +@@ -0,0 +1,573 @@ ++{ ++ "tests": [ ++ { ++ "name": "versionValid", ++ "description": "Test a simple source map with a valid version number", ++ "baseFile": "version-valid.js", ++ "sourceMapFile": "version-valid.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "versionMissing", ++ "description": "Test a source map that is missing a version field", ++ "baseFile": "version-missing.js", ++ "sourceMapFile": "version-missing.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionNotANumber", ++ "description": "Test a source map with a version field that is not a number", ++ "baseFile": "version-not-a-number.js", ++ "sourceMapFile": "version-not-a-number.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionNumericString", ++ "description": "Test a source map with a version field that is a number as a string", ++ "baseFile": "version-numeric-string.js", ++ "sourceMapFile": "version-numeric-string.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionTooHigh", ++ "description": "Test a source map with an integer version field that is too high", ++ "baseFile": "version-too-high.js", ++ "sourceMapFile": "version-too-high.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionTooLow", ++ "description": "Test a source map with an integer version field that is too low", ++ "baseFile": "version-too-low.js", ++ "sourceMapFile": "version-too-low.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "sourcesMissing", ++ "description": "Test a source map that is missing a necessary sources field", ++ "baseFile": "sources-missing.js", ++ "sourceMapFile": "sources-missing.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "sourcesNotAList1", ++ "description": "Test a source map with a sources field that is not a valid list (string)", ++ "baseFile": "sources-not-a-list-1.js", ++ "sourceMapFile": "sources-not-a-list-1.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "sourcesNotAList2", ++ "description": "Test a source map with a sources field that is not a valid list (object)", ++ "baseFile": "sources-not-a-list-2.js", ++ "sourceMapFile": "sources-not-a-list-2.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "sourcesNotStringOrNull", ++ "description": "Test a source map with a sources list that has non-string and non-null items", ++ "baseFile": "sources-not-string-or-null.js", ++ "sourceMapFile": "sources-not-string-or-null.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "namesMissing", ++ "description": "Test a source map that is missing a necessary names field", ++ "baseFile": "names-missing.js", ++ "sourceMapFile": "names-missing.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "namesNotAList1", ++ "description": "Test a source map with a names field that is not a valid list (string)", ++ "baseFile": "names-not-a-list-1.js", ++ "sourceMapFile": "names-not-a-list-1.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "namesNotAList2", ++ "description": "Test a source map with a names field that is not a valid list (object)", ++ "baseFile": "names-not-a-list-2.js", ++ "sourceMapFile": "names-not-a-list-2.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "namesNotString", ++ "description": "Test a source map with a names list that has non-string items", ++ "baseFile": "names-not-string.js", ++ "sourceMapFile": "names-not-string.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "unrecognizedProperty", ++ "description": "Test a source map that has an extra field not explicitly encoded in the spec", ++ "baseFile": "unrecognized-property.js", ++ "sourceMapFile": "unrecognized-property.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "invalidVLQDueToNonBase64Character", ++ "description": "Test a source map that has a mapping with an invalid non-base64 character", ++ "baseFile": "invalid-vlq-non-base64-char.js", ++ "sourceMapFile": "invalid-vlq-non-base64-char.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingNotAString1", ++ "description": "Test a source map that has an invalid mapping that is not a string (number)", ++ "baseFile": "invalid-mapping-not-a-string-1.js", ++ "sourceMapFile": "invalid-mapping-not-a-string-1.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingNotAString2", ++ "description": "Test a source map that has an invalid mapping that is not a string (array)", ++ "baseFile": "invalid-mapping-not-a-string-2.js", ++ "sourceMapFile": "invalid-mapping-not-a-string-2.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentBadSeparator", ++ "description": "Test a source map that uses separator characters not recognized in the spec", ++ "baseFile": "invalid-mapping-bad-separator.js", ++ "sourceMapFile": "invalid-mapping-bad-separator.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithZeroFields", ++ "description": "Test a source map that has the wrong number (zero) of segments fields", ++ "baseFile": "invalid-mapping-segment-with-zero-fields.js", ++ "sourceMapFile": "invalid-mapping-segment-with-zero-fields.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithTwoFields", ++ "description": "Test a source map that has the wrong number (two) of segments fields", ++ "baseFile": "invalid-mapping-segment-with-two-fields.js", ++ "sourceMapFile": "invalid-mapping-segment-with-two-fields.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithThreeFields", ++ "description": "Test a source map that has the wrong number (three) of segments fields", ++ "baseFile": "invalid-mapping-segment-with-three-fields.js", ++ "sourceMapFile": "invalid-mapping-segment-with-three-fields.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithSourceIndexOutOfBounds", ++ "description": "Test a source map that has a source index field that is out of bounds of the sources field", ++ "baseFile": "invalid-mapping-segment-source-index-out-of-bounds.js", ++ "sourceMapFile": "invalid-mapping-segment-source-index-out-of-bounds.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNameIndexOutOfBounds", ++ "description": "Test a source map that has a name index field that is out of bounds of the names field", ++ "baseFile": "invalid-mapping-segment-name-index-out-of-bounds.js", ++ "sourceMapFile": "invalid-mapping-segment-name-index-out-of-bounds.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeColumn", ++ "description": "Test a source map that has an invalid negative non-relative column field", ++ "baseFile": "invalid-mapping-segment-negative-column.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-column.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeSourceIndex", ++ "description": "Test a source map that has an invalid negative non-relative source index field", ++ "baseFile": "invalid-mapping-segment-negative-source-index.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-source-index.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeOriginalLine", ++ "description": "Test a source map that has an invalid negative non-relative original line field", ++ "baseFile": "invalid-mapping-segment-negative-original-line.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-original-line.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeOriginalColumn", ++ "description": "Test a source map that has an invalid negative non-relative original column field", ++ "baseFile": "invalid-mapping-segment-negative-original-column.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-original-column.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeNameIndex", ++ "description": "Test a source map that has an invalid negative non-relative name index field", ++ "baseFile": "invalid-mapping-segment-negative-name-index.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-name-index.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithColumnExceeding32Bits", ++ "description": "Test a source map that has a column field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-column-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-column-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithSourceIndexExceeding32Bits", ++ "description": "Test a source map that has a source index field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-source-index-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-source-index-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithOriginalLineExceeding32Bits", ++ "description": "Test a source map that has a original line field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-original-line-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-original-line-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithOriginalColumnExceeding32Bits", ++ "description": "Test a source map that has an original column field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-original-column-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-original-column-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNameIndexExceeding32Bits", ++ "description": "Test a source map that has a name index field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-name-index-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-name-index-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "validMappingFieldsWith32BitMaxValues", ++ "description": "Test a source map that has segment fields with max values representable in 32 bits", ++ "baseFile": "valid-mapping-boundary-values.js", ++ "sourceMapFile": "valid-mapping-boundary-values.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "validMappingLargeVLQ", ++ "description": "Test a source map that has a segment field VLQ that is very long but within 32-bits", ++ "baseFile": "valid-mapping-large-vlq.js", ++ "sourceMapFile": "valid-mapping-large-vlq.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "validMappingEmptyGroups", ++ "description": "Test a source map with a mapping that has many empty groups", ++ "baseFile": "valid-mapping-empty-groups.js", ++ "sourceMapFile": "valid-mapping-empty-groups.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "indexMapInvalidBaseMapings", ++ "description": "Test that an index map cannot also have a regular mappings field", ++ "baseFile": "index-map-invalid-base-mappings.js", ++ "sourceMapFile": "index-map-invalid-base-mappings.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "indexMapInvalidOverlap", ++ "description": "Test that an invalid index map with multiple sections that overlap", ++ "baseFile": "index-map-invalid-overlap.js", ++ "sourceMapFile": "index-map-invalid-overlap.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "indexMapMissingOffset", ++ "description": "Test that an index map that is missing a section offset", ++ "baseFile": "index-map-missing-offset.js", ++ "sourceMapFile": "index-map-missing-offset.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "indexMapMissingOffsetLine", ++ "description": "Test that an index map that is missing a section offset's line field", ++ "baseFile": "index-map-missing-offset-line.js", ++ "sourceMapFile": "index-map-missing-offset-line.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "indexMapMissingOffsetColumn", ++ "description": "Test that an index map that is missing a section offset's column field", ++ "baseFile": "index-map-missing-offset-column.js", ++ "sourceMapFile": "index-map-missing-offset-column.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "indexMapOffsetLineWrongType", ++ "description": "Test that an index map that has an offset line field with the wrong type of value", ++ "baseFile": "index-map-offset-line-wrong-type.js", ++ "sourceMapFile": "index-map-offset-line-wrong-type.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "indexMapOffsetColumnWrongType", ++ "description": "Test that an index map that has an offset column field with the wrong type of value", ++ "baseFile": "index-map-offset-column-wrong-type.js", ++ "sourceMapFile": "index-map-offset-column-wrong-type.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "basicMapping", ++ "description": "Test a simple source map that has several valid mappings", ++ "baseFile": "basic-mapping.js", ++ "sourceMapFile": "basic-mapping.js.map", ++ "sourceMapIsValid": true, ++ "testActions": [ ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 0, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 9, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 9, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 15, ++ "originalLine": 1, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 22, ++ "originalLine": 1, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 24, ++ "originalLine": 2, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 25, ++ "originalLine": 3, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 34, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 3, ++ "originalColumn": 9, ++ "mappedName": "bar" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 40, ++ "originalLine": 4, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 47, ++ "originalLine": 4, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 49, ++ "originalLine": 5, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 50, ++ "originalLine": 6, ++ "originalColumn": 0, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 56, ++ "originalLine": 7, ++ "originalColumn": 0, ++ "mappedName": "bar" ++ } ++ ] ++ }, ++ { ++ "name": "basicMappingWithIndexMap", ++ "description": "Test a version of basic-mapping.js.map that is split into sections with an index map", ++ "baseFile": "basic-mapping-as-index-map.js", ++ "sourceMapFile": "basic-mapping-as-index-map.js.map", ++ "sourceMapIsValid": true, ++ "testActions": [ ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 0, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 9, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 9, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 15, ++ "originalLine": 1, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 22, ++ "originalLine": 1, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 24, ++ "originalLine": 2, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 25, ++ "originalLine": 3, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 34, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 3, ++ "originalColumn": 9, ++ "mappedName": "bar" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 40, ++ "originalLine": 4, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 47, ++ "originalLine": 4, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 49, ++ "originalLine": 5, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 50, ++ "originalLine": 6, ++ "originalColumn": 0, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 56, ++ "originalLine": 7, ++ "originalColumn": 0, ++ "mappedName": "bar" ++ } ++ ] ++ }, ++ { ++ "name": "validMappingNullSources", ++ "description": "Test a source map that has null sources", ++ "baseFile": "valid-mapping-null-sources.js", ++ "sourceMapFile": "valid-mapping-null-sources.js.map", ++ "sourceMapIsValid": true, ++ "testActions": [ ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 0, ++ "originalSource": null, ++ "originalLine": 0, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 9, ++ "originalSource": null, ++ "originalLine": 0, ++ "originalColumn": 9, ++ "mappedName": "foo" ++ } ++ ] ++ } ++ ] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-missing.js b/front_end/core/sdk/fixtures/sourcemaps/sources-missing.js +new file mode 100644 +index 0000000000..779b865e27 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-missing.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=sources-missing.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-missing.js.map b/front_end/core/sdk/fixtures/sourcemaps/sources-missing.js.map +new file mode 100644 +index 0000000000..92aff4fb0e +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-missing.js.map +@@ -0,0 +1,5 @@ ++{ ++ "version" : 3, ++ "names": ["foo"], ++ "mappings": "" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js +new file mode 100644 +index 0000000000..7e33b7e867 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=sources-not-a-list-1.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js.map b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js.map +new file mode 100644 +index 0000000000..26330517b9 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-1.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": "not a list", ++ "names": ["foo"], ++ "mappings": "AAAAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js +new file mode 100644 +index 0000000000..4021f763fc +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=sources-not-a-list-2.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js.map b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js.map +new file mode 100644 +index 0000000000..2ed85962fd +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-not-a-list-2.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": { "source.js": 3 }, ++ "names": ["foo"], ++ "mappings": "AAAAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js b/front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js +new file mode 100644 +index 0000000000..7dca97a1da +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=sources-not-string-or-null.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js.map b/front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js.map +new file mode 100644 +index 0000000000..db25561966 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/sources-not-string-or-null.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": [3, {}, true, false, []], ++ "names": ["foo"], ++ "mappings": "AAAAA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js b/front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js +new file mode 100644 +index 0000000000..19dfb0e2e6 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=unrecognized-property.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js.map b/front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js.map +new file mode 100644 +index 0000000000..40bee558a4 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/unrecognized-property.js.map +@@ -0,0 +1,8 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "", ++ "foobar": 42, ++ "unusedProperty": [1, 2, 3, 4] ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js +new file mode 100644 +index 0000000000..3c49709e05 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=valid-mapping-boundary-values.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js.map b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js.map +new file mode 100644 +index 0000000000..4dd836e63d +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-boundary-values.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": ["foo"], ++ "file": "valid-mapping-boundary-values.js", ++ "sources": ["empty-original.js"], ++ "mappings": "+/////DA+/////D+/////DA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js +new file mode 100644 +index 0000000000..a2b767b619 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=valid-mapping-empty-groups.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js.map b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js.map +new file mode 100644 +index 0000000000..53be4ae4ae +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-empty-groups.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "valid-mapping-empty-groups.js", ++ "sources": ["empty-original.js"], ++ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js +new file mode 100644 +index 0000000000..b0cd897813 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=valid-mapping-large-vlq.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js.map b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js.map +new file mode 100644 +index 0000000000..76e18704c4 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-large-vlq.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": [], ++ "sources": ["valid-mapping-large-vlq.js"], ++ "mappings": "igggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js +new file mode 100644 +index 0000000000..ee2acf0f5b +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=valid-mapping-null-sources.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js.map b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js.map +new file mode 100644 +index 0000000000..199cda9369 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/valid-mapping-null-sources.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version":3, ++ "names": ["foo"], ++ "sources": [null], ++ "mappings":"AAAA,SAASA" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-missing.js b/front_end/core/sdk/fixtures/sourcemaps/version-missing.js +new file mode 100644 +index 0000000000..c32d1f1a1c +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-missing.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-missing.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-missing.js.map b/front_end/core/sdk/fixtures/sourcemaps/version-missing.js.map +new file mode 100644 +index 0000000000..49d8ce766e +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-missing.js.map +@@ -0,0 +1,5 @@ ++{ ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js b/front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js +new file mode 100644 +index 0000000000..ae2342e2ff +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-not-a-number.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js.map b/front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js.map +new file mode 100644 +index 0000000000..a584d6e695 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-not-a-number.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3foo", ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js b/front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js +new file mode 100644 +index 0000000000..a55170885d +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-numeric-string.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js.map b/front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js.map +new file mode 100644 +index 0000000000..dbe52a7d0d +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-numeric-string.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3", ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-too-high.js b/front_end/core/sdk/fixtures/sourcemaps/version-too-high.js +new file mode 100644 +index 0000000000..55f4e1a298 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-too-high.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-too-high.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-too-high.js.map b/front_end/core/sdk/fixtures/sourcemaps/version-too-high.js.map +new file mode 100644 +index 0000000000..ee23be32ff +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-too-high.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 4, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-too-low.js b/front_end/core/sdk/fixtures/sourcemaps/version-too-low.js +new file mode 100644 +index 0000000000..d9642920b3 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-too-low.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-too-low.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-too-low.js.map b/front_end/core/sdk/fixtures/sourcemaps/version-too-low.js.map +new file mode 100644 +index 0000000000..64ca7a6e2e +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-too-low.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 2, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-valid.js b/front_end/core/sdk/fixtures/sourcemaps/version-valid.js +new file mode 100644 +index 0000000000..82d0bfa1eb +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-valid.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-valid.js.map +diff --git a/front_end/core/sdk/fixtures/sourcemaps/version-valid.js.map b/front_end/core/sdk/fixtures/sourcemaps/version-valid.js.map +new file mode 100644 +index 0000000000..1a163052d8 +--- /dev/null ++++ b/front_end/core/sdk/fixtures/sourcemaps/version-valid.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +-- +2.39.3 (Apple Git-145) + diff --git a/chrome/0002-add-test-for-valid-sourcemaps.patch b/chrome/0002-add-test-for-valid-sourcemaps.patch new file mode 100644 index 0000000..d95f240 --- /dev/null +++ b/chrome/0002-add-test-for-valid-sourcemaps.patch @@ -0,0 +1,59 @@ +From ddcad1d602ba5201ebd8560b44731232114a0c9d Mon Sep 17 00:00:00 2001 +From: Agata Belkius +Date: Tue, 30 Apr 2024 13:53:36 +0100 +Subject: [PATCH 2/3] add test for valid sourcemaps + +--- + front_end/core/sdk/SourceMapSpec.test.ts | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/front_end/core/sdk/SourceMapSpec.test.ts b/front_end/core/sdk/SourceMapSpec.test.ts +index 64f350d7f3..d8953d42fa 100644 +--- a/front_end/core/sdk/SourceMapSpec.test.ts ++++ b/front_end/core/sdk/SourceMapSpec.test.ts +@@ -30,7 +30,7 @@ + const {assert} = chai; + import type * as Platform from '../platform/platform.js'; + import {assertNotNullOrUndefined} from '../platform/platform.js'; +-import { SourceMapV3 } from './SourceMap.js'; ++import { SourceMapV3, parseSourceMap } from './SourceMap.js'; + import * as SDK from './sdk.js'; + import {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js'; + +@@ -62,21 +62,30 @@ describeWithEnvironment.only('SourceMapSpec', async () => { + testActions, + sourceMapIsValid + }) => { +- it(`checks mappings for ${sourceMapFile}`, async () => { ++ it(`tests ${sourceMapFile}`, async () => { + if (!sourceMapIsValid) { ++ // TODO - right now most of the failure scenarios are actually passing + return; + } + ++ // check if a valid sourcemap can be loaded and a SourceMap object created + const baseFileUrl = baseFile as Platform.DevToolsPath.UrlString; + const sourceMapFileUrl = sourceMapFile as Platform.DevToolsPath.UrlString; + const sourceMapContent = await loadSourceMapFromFixture(sourceMapFile); +- ++ ++ assert.doesNotThrow(() => parseSourceMap(JSON.stringify(sourceMapContent))); ++ assert.doesNotThrow(() => new SDK.SourceMap.SourceMap( ++ baseFileUrl, ++ sourceMapFileUrl, ++ sourceMapContent ++ )); ++ ++ // check if the mappings are valid + const sourceMap = new SDK.SourceMap.SourceMap( + baseFileUrl, + sourceMapFileUrl, + sourceMapContent); + +- + if (testActions !== undefined) { + testActions.forEach(({ + actionType, +-- +2.39.3 (Apple Git-145) + diff --git a/chrome/0003-add-more-tests-cases.patch b/chrome/0003-add-more-tests-cases.patch new file mode 100644 index 0000000..34e22eb --- /dev/null +++ b/chrome/0003-add-more-tests-cases.patch @@ -0,0 +1,108 @@ +From f07ac89859cef0b251c38310d0933092faf6a652 Mon Sep 17 00:00:00 2001 +From: Agata Belkius +Date: Thu, 2 May 2024 11:09:27 +0100 +Subject: [PATCH 3/3] add more tests cases + +--- + front_end/core/sdk/SourceMapSpec.test.ts | 65 +++++++++++++++++++++--- + 1 file changed, 59 insertions(+), 6 deletions(-) + +diff --git a/front_end/core/sdk/SourceMapSpec.test.ts b/front_end/core/sdk/SourceMapSpec.test.ts +index d8953d42fa..2d6818f785 100644 +--- a/front_end/core/sdk/SourceMapSpec.test.ts ++++ b/front_end/core/sdk/SourceMapSpec.test.ts +@@ -60,18 +60,68 @@ describeWithEnvironment.only('SourceMapSpec', async () => { + baseFile, + sourceMapFile, + testActions, +- sourceMapIsValid ++ sourceMapIsValid, ++ name + }) => { + it(`tests ${sourceMapFile}`, async () => { ++ const consoleErrorSpy = sinon.spy(console, 'error'); ++ const sourceMapContent = await loadSourceMapFromFixture(sourceMapFile); ++ ++ // 1) check if an invalid sourcemap throws on SourceMap instance creation ++ if (!sourceMapIsValid && [ ++ 'sourcesMissing', ++ 'indexMapMissingOffset' ++ ].includes(name)) { ++ assert.throws(() => new SDK.SourceMap.SourceMap( ++ baseFile as Platform.DevToolsPath.UrlString, ++ sourceMapFile as Platform.DevToolsPath.UrlString, ++ sourceMapContent ++ )); ++ ++ return; ++ } ++ ++ // 2) check if an invalid sourcemap throws on mapping creation ++ if (!sourceMapIsValid && [ ++ 'invalidVLQDueToNonBase64Character', ++ 'invalidMappingNotAString1', ++ 'invalidMappingNotAString2', ++ 'invalidMappingSegmentBadSeparator', ++ 'invalidMappingSegmentWithZeroFields', ++ 'invalidMappingSegmentWithTwoFields', ++ 'invalidMappingSegmentWithThreeFields' ++ ].includes(name)) { ++ const sourceMap = new SDK.SourceMap.SourceMap( ++ baseFile as Platform.DevToolsPath.UrlString, ++ sourceMapFile as Platform.DevToolsPath.UrlString, ++ sourceMapContent ++ ); ++ ++ // TODO - findEntry or just mappings should be used here? mappings is the culprit ++ // but it is called from different other methods e.g: findEntry() ++ sourceMap.mappings(); ++ assert.equal(consoleErrorSpy.calledWith("Failed to parse source map"), true); ++ ++ return; ++ } ++ ++ // 3) check if an invalid sourcemap can have the mapping created + if (!sourceMapIsValid) { ++ const sourceMap = new SDK.SourceMap.SourceMap( ++ baseFile as Platform.DevToolsPath.UrlString, ++ sourceMapFile as Platform.DevToolsPath.UrlString, ++ sourceMapContent ++ ); ++ sourceMap.mappings(); + // TODO - right now most of the failure scenarios are actually passing +- return; ++ assert.equal(consoleErrorSpy.notCalled, true); ++ console.warn('Invalid sourcemap passes basic validation'); + } ++ + +- // check if a valid sourcemap can be loaded and a SourceMap object created ++ // 4) check if a valid sourcemap can be parsed and a SourceMap instance created + const baseFileUrl = baseFile as Platform.DevToolsPath.UrlString; + const sourceMapFileUrl = sourceMapFile as Platform.DevToolsPath.UrlString; +- const sourceMapContent = await loadSourceMapFromFixture(sourceMapFile); + + assert.doesNotThrow(() => parseSourceMap(JSON.stringify(sourceMapContent))); + assert.doesNotThrow(() => new SDK.SourceMap.SourceMap( +@@ -79,13 +129,16 @@ describeWithEnvironment.only('SourceMapSpec', async () => { + sourceMapFileUrl, + sourceMapContent + )); ++ + +- // check if the mappings are valid ++ // 5) check if the mappings are valid + const sourceMap = new SDK.SourceMap.SourceMap( + baseFileUrl, + sourceMapFileUrl, + sourceMapContent); +- ++ ++ assert.doesNotThrow(() => sourceMap.findEntry(1, 1)); ++ + if (testActions !== undefined) { + testActions.forEach(({ + actionType, +-- +2.39.3 (Apple Git-145) + diff --git a/firefox/0001-WIP-Firefox-source-map-spec-tests.patch b/firefox/0001-WIP-Firefox-source-map-spec-tests.patch new file mode 100644 index 0000000..a9e256e --- /dev/null +++ b/firefox/0001-WIP-Firefox-source-map-spec-tests.patch @@ -0,0 +1,337 @@ +From 8327515870d595ab04a111f6c37b84eab8a5010c Mon Sep 17 00:00:00 2001 +From: Asumu Takikawa +Date: Tue, 27 Feb 2024 18:22:45 -0800 +Subject: [PATCH] WIP Firefox source map spec tests + +--- + .../test/browser/browser.toml | 2 + + .../test/browser/browser_spec-source-map.js | 68 +++++++++++++++++++ + .../fixtures/basic-mapping-original.js | 8 +++ + .../test/browser/fixtures/basic-mapping.js | 1 + + .../browser/fixtures/basic-mapping.js.map | 6 ++ + .../fixtures/source-map-spec-tests.json | 60 ++++++++++++++++ + .../browser/fixtures/unrecognized-property.js | 1 + + .../fixtures/unrecognized-property.js.map | 8 +++ + .../browser/fixtures/version-not-a-number.js | 1 + + .../fixtures/version-not-a-number.js.map | 6 ++ + .../test/browser/fixtures/version-numbers.js | 6 ++ + .../test/browser/fixtures/version-too-high.js | 1 + + .../browser/fixtures/version-too-high.js.map | 6 ++ + .../test/browser/fixtures/version-too-low.js | 1 + + .../browser/fixtures/version-too-low.js.map | 6 ++ + .../test/browser/fixtures/version-valid.js | 1 + + .../browser/fixtures/version-valid.js.map | 6 ++ + 17 files changed, 188 insertions(+) + create mode 100644 devtools/client/shared/source-map-loader/test/browser/browser_spec-source-map.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping-original.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js.map + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/source-map-spec-tests.json + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js.map + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js.map + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-numbers.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js.map + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js.map + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js + create mode 100644 devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js.map + +diff --git a/devtools/client/shared/source-map-loader/test/browser/browser.toml b/devtools/client/shared/source-map-loader/test/browser/browser.toml +index 5a602e9eeb893..a670ab0acee89 100644 +--- a/devtools/client/shared/source-map-loader/test/browser/browser.toml ++++ b/devtools/client/shared/source-map-loader/test/browser/browser.toml +@@ -19,3 +19,5 @@ skip-if = [ + "http3", # Bug 1829298 + "http2", + ] ++ ++["browser_spec-source-map.js"] +diff --git a/devtools/client/shared/source-map-loader/test/browser/browser_spec-source-map.js b/devtools/client/shared/source-map-loader/test/browser/browser_spec-source-map.js +new file mode 100644 +index 0000000000000..34695d6bd395b +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/browser_spec-source-map.js +@@ -0,0 +1,68 @@ ++"use strict"; ++ ++const { ++ generatedToOriginalId, ++} = require("resource://devtools/client/shared/source-map-loader/utils/index.js"); ++ ++async function isValidSourceMap(base) { ++ try { ++ await fetchFixtureSourceMap(base); ++ } catch (exn) { ++ return false; ++ } ++ return true; ++} ++ ++async function checkMapping(testCase, action) { ++ const originalId = generatedToOriginalId(testCase.baseFile, `${URL_ROOT_SSL}fixtures/${action.originalSource}`); ++ const generatedLoc = await gSourceMapLoader.getGeneratedLocation({ ++ sourceId: originalId, ++ line: action.originalLine + 1, ++ column: action.originalColumn, ++ }); ++ Assert.ok(generatedLoc !== null, "Location lookup should not return null"); ++ Assert.equal(testCase.baseFile, generatedLoc.sourceId); ++ Assert.equal(action.generatedLine + 1, generatedLoc.line); ++ Assert.equal(action.generatedColumn, generatedLoc.column); ++} ++ ++const SPEC_TESTS_URI = `${URL_ROOT_SSL}fixtures/source-map-spec-tests.json` ++const testDescriptions = JSON.parse(read(SPEC_TESTS_URI)); ++ ++for (const testCase of testDescriptions.tests) { ++ async function testFunction() { ++ const baseName = testCase.baseFile.substring(0, testCase.baseFile.indexOf(".js")); ++ Assert.equal(testCase.sourceMapIsValid, await isValidSourceMap(baseName)); ++ ++ if (testCase.testActions) { ++ for (const action of testCase.testActions) { ++ if (action.actionType === "checkMapping") ++ await checkMapping(testCase, action); ++ } ++ } ++ }; ++ Object.defineProperty(testFunction, "name", { value: testCase.name }); ++ add_task(testFunction); ++} ++ ++function read(srcChromeURL) { ++ const scriptableStream = Cc[ ++ "@mozilla.org/scriptableinputstream;1" ++ ].getService(Ci.nsIScriptableInputStream); ++ ++ const channel = NetUtil.newChannel({ ++ uri: srcChromeURL, ++ loadUsingSystemPrincipal: true, ++ }); ++ const input = channel.open(); ++ scriptableStream.init(input); ++ ++ let data = ""; ++ while (input.available()) { ++ data = data.concat(scriptableStream.read(input.available())); ++ } ++ scriptableStream.close(); ++ input.close(); ++ ++ return data; ++} +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping-original.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping-original.js +new file mode 100644 +index 0000000000000..301b186cb15e6 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping-original.js +@@ -0,0 +1,8 @@ ++function foo() { ++ return 42; ++} ++function bar() { ++ return 24; ++} ++foo(); ++bar(); +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js +new file mode 100644 +index 0000000000000..9df72406be544 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js +@@ -0,0 +1 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); +\ No newline at end of file +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js.map b/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js.map +new file mode 100644 +index 0000000000000..12dc9679a4b1d +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/basic-mapping.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version":3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings":"AAAA,SAASA,MACP,OAAO,EACT,CACA,SAASC,MACP,OAAO,EACT,CACAD,MACAC" ++} +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/source-map-spec-tests.json b/devtools/client/shared/source-map-loader/test/browser/fixtures/source-map-spec-tests.json +new file mode 100644 +index 0000000000000..16d8442811655 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/source-map-spec-tests.json +@@ -0,0 +1,60 @@ ++{ ++ "tests": [ ++ { ++ "name": "versionValid", ++ "baseFile": "version-valid.js", ++ "sourceMapFile": "version-valid.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "versionNotANumber", ++ "baseFile": "version-not-a-number.js", ++ "sourceMapFile": "version-not-a-number.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionTooHigh", ++ "baseFile": "version-too-high.js", ++ "sourceMapFile": "version-too-high.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionTooLow", ++ "baseFile": "version-too-low.js", ++ "sourceMapFile": "version-too-low.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "unrecognizedProperty", ++ "baseFile": "unrecognized-property.js", ++ "sourceMapFile": "unrecognized-property.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "basicMapping", ++ "baseFile": "basic-mapping.js", ++ "sourceMapFile": "basic-mapping.js.map", ++ "sourceMapIsValid": true, ++ "testActions": [ ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 9, ++ "generatedLine": 0, ++ "generatedColumn": 9, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 3, ++ "originalColumn": 9, ++ "generatedLine": 0, ++ "generatedColumn": 34, ++ "mappedName": "bar" ++ } ++ ] ++ } ++ ] ++} +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js +new file mode 100644 +index 0000000000000..47303d1fcf302 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js +@@ -0,0 +1 @@ ++// # sourceMappingURL=unrecognized-property.js.map +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js.map b/devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js.map +new file mode 100644 +index 0000000000000..40bee558a4ff9 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/unrecognized-property.js.map +@@ -0,0 +1,8 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "", ++ "foobar": 42, ++ "unusedProperty": [1, 2, 3, 4] ++} +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js +new file mode 100644 +index 0000000000000..5382a716e3a21 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js +@@ -0,0 +1 @@ ++// # sourceMappingURL=version-not-a-number.js.map +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js.map b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js.map +new file mode 100644 +index 0000000000000..a584d6e695117 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-not-a-number.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3foo", ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-numbers.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-numbers.js +new file mode 100644 +index 0000000000000..e79993b659db6 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-numbers.js +@@ -0,0 +1,6 @@ ++// Test that invalid version numbers are rejected. ++ ++assert(isValidSourceMap("./version-valid.map")); ++assert(!isValidSourceMap("./version-not-a-number.map")); ++assert(!isValidSourceMap("./version-too-low.map")); ++assert(!isValidSourceMap("./version-too-high.map")); +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js +new file mode 100644 +index 0000000000000..04bfe7f62b7b9 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js +@@ -0,0 +1 @@ ++// # sourceMappingURL=version-too-high.js.map +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js.map b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js.map +new file mode 100644 +index 0000000000000..ee23be32ff278 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-high.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 4, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js +new file mode 100644 +index 0000000000000..54b3526c6b5e2 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js +@@ -0,0 +1 @@ ++// # sourceMappingURL=version-too-low.js.map +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js.map b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js.map +new file mode 100644 +index 0000000000000..64ca7a6e2e928 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-too-low.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 2, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js +new file mode 100644 +index 0000000000000..f8541f9efdc71 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js +@@ -0,0 +1 @@ ++// # sourceMappingURL=version-valid.js.map +diff --git a/devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js.map b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js.map +new file mode 100644 +index 0000000000000..1a163052d8fc8 +--- /dev/null ++++ b/devtools/client/shared/source-map-loader/test/browser/fixtures/version-valid.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +-- +2.39.2 + diff --git a/firefox/browser_spec-source-map.js b/firefox/browser_spec-source-map.js new file mode 100644 index 0000000..af18e9b --- /dev/null +++ b/firefox/browser_spec-source-map.js @@ -0,0 +1,71 @@ +"use strict"; + +const { + generatedToOriginalId, +} = require("resource://devtools/client/shared/source-map-loader/utils/index.js"); + +async function checkValidity(isValid, base, testCase) { + try { + await fetchFixtureSourceMap(base); + const originalId = generatedToOriginalId(testCase.baseFile, "unused"); + await gSourceMapLoader.getOriginalRanges(originalId); + } catch (exn) { + Assert.ok(!isValid, "Source map loading failed with " + exn.message); + return; + } + Assert.ok(isValid, "Source map loading should have failed but did not"); +} + +async function checkMapping(testCase, action) { + const originalId = generatedToOriginalId(testCase.baseFile, `${URL_ROOT_SSL}fixtures/${action.originalSource}`); + const generatedLoc = await gSourceMapLoader.getGeneratedLocation({ + sourceId: originalId, + line: action.originalLine + 1, + column: action.originalColumn, + }); + Assert.ok(generatedLoc !== null, "Location lookup should not return null"); + Assert.equal(testCase.baseFile, generatedLoc.sourceId); + Assert.equal(action.generatedLine + 1, generatedLoc.line); + Assert.equal(action.generatedColumn, generatedLoc.column); +} + +const SPEC_TESTS_URI = `${URL_ROOT_SSL}fixtures/source-map-spec-tests.json` +const testDescriptions = JSON.parse(read(SPEC_TESTS_URI)); + +for (const testCase of testDescriptions.tests) { + // The following uses a hack to ensure the test case name is used in stack traces. + const testFunction = {[testCase.name]: async function() { + const baseName = testCase.baseFile.substring(0, testCase.baseFile.indexOf(".js")); + await checkValidity(testCase.sourceMapIsValid, baseName, testCase); + + if (testCase.testActions) { + for (const action of testCase.testActions) { + if (action.actionType === "checkMapping") + await checkMapping(testCase, action); + } + } + }}[testCase.name]; + add_task(testFunction); +} + +function read(srcChromeURL) { + const scriptableStream = Cc[ + "@mozilla.org/scriptableinputstream;1" + ].getService(Ci.nsIScriptableInputStream); + + const channel = NetUtil.newChannel({ + uri: srcChromeURL, + loadUsingSystemPrincipal: true, + }); + const input = channel.open(); + scriptableStream.init(input); + + let data = ""; + while (input.available()) { + data = data.concat(scriptableStream.read(input.available())); + } + scriptableStream.close(); + input.close(); + + return data; +} diff --git a/resources/basic-mapping-as-index-map.js b/resources/basic-mapping-as-index-map.js new file mode 100644 index 0000000..b9fae38 --- /dev/null +++ b/resources/basic-mapping-as-index-map.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar(); +//# sourceMappingURL=basic-mapping-as-index-map.js.map diff --git a/resources/basic-mapping-as-index-map.js.map b/resources/basic-mapping-as-index-map.js.map new file mode 100644 index 0000000..8a6d4b5 --- /dev/null +++ b/resources/basic-mapping-as-index-map.js.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 0, "column": 0 }, + "map": { + "version": 3, + "names": ["foo","bar"], + "sources": ["basic-mapping-original.js"], + "mappings": "AAAA,SAASA,MACP,OAAO,EACT,CACA,SAASC,MACP,OAAO,EACT,CACAD,MACAC" + } + } + ] +} diff --git a/resources/basic-mapping-original.js b/resources/basic-mapping-original.js new file mode 100644 index 0000000..301b186 --- /dev/null +++ b/resources/basic-mapping-original.js @@ -0,0 +1,8 @@ +function foo() { + return 42; +} +function bar() { + return 24; +} +foo(); +bar(); diff --git a/resources/basic-mapping.js b/resources/basic-mapping.js new file mode 100644 index 0000000..2e479a4 --- /dev/null +++ b/resources/basic-mapping.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar(); +//# sourceMappingURL=basic-mapping.js.map diff --git a/resources/basic-mapping.js.map b/resources/basic-mapping.js.map new file mode 100644 index 0000000..12dc967 --- /dev/null +++ b/resources/basic-mapping.js.map @@ -0,0 +1,6 @@ +{ + "version":3, + "names": ["foo","bar"], + "sources": ["basic-mapping-original.js"], + "mappings":"AAAA,SAASA,MACP,OAAO,EACT,CACA,SAASC,MACP,OAAO,EACT,CACAD,MACAC" +} diff --git a/resources/ignore-list-empty.js b/resources/ignore-list-empty.js new file mode 100644 index 0000000..385a5c3 --- /dev/null +++ b/resources/ignore-list-empty.js @@ -0,0 +1 @@ +//# sourceMappingURL=ignore-list-empty.js.map diff --git a/resources/ignore-list-empty.js.map b/resources/ignore-list-empty.js.map new file mode 100644 index 0000000..7297863 --- /dev/null +++ b/resources/ignore-list-empty.js.map @@ -0,0 +1,8 @@ +{ + "version" : 3, + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "names": [], + "ignoreList": [] +} diff --git a/resources/ignore-list-out-of-bounds.js b/resources/ignore-list-out-of-bounds.js new file mode 100644 index 0000000..7a0fbb8 --- /dev/null +++ b/resources/ignore-list-out-of-bounds.js @@ -0,0 +1 @@ +//# sourceMappingURL=ignore-list-out-of-bounds.js.map diff --git a/resources/ignore-list-out-of-bounds.js.map b/resources/ignore-list-out-of-bounds.js.map new file mode 100644 index 0000000..fb2566b --- /dev/null +++ b/resources/ignore-list-out-of-bounds.js.map @@ -0,0 +1,8 @@ +{ + "version" : 3, + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "names": [], + "ignoreList": [1] +} diff --git a/resources/ignore-list-valid-1.js b/resources/ignore-list-valid-1.js new file mode 100644 index 0000000..ea64a55 --- /dev/null +++ b/resources/ignore-list-valid-1.js @@ -0,0 +1 @@ +//# sourceMappingURL=ignore-list-valid-1.js.map diff --git a/resources/ignore-list-valid-1.js.map b/resources/ignore-list-valid-1.js.map new file mode 100644 index 0000000..98eebdf --- /dev/null +++ b/resources/ignore-list-valid-1.js.map @@ -0,0 +1,8 @@ +{ + "version" : 3, + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "names": [], + "ignoreList": [0] +} diff --git a/resources/ignore-list-wrong-type-1.js b/resources/ignore-list-wrong-type-1.js new file mode 100644 index 0000000..8b40bd3 --- /dev/null +++ b/resources/ignore-list-wrong-type-1.js @@ -0,0 +1 @@ +//# sourceMappingURL=ignore-list-wrong-type-1.js.map diff --git a/resources/ignore-list-wrong-type-1.js.map b/resources/ignore-list-wrong-type-1.js.map new file mode 100644 index 0000000..688740a --- /dev/null +++ b/resources/ignore-list-wrong-type-1.js.map @@ -0,0 +1,8 @@ +{ + "version" : 3, + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "names": [], + "ignoreList": ["not a number"] +} diff --git a/resources/ignore-list-wrong-type-2.js b/resources/ignore-list-wrong-type-2.js new file mode 100644 index 0000000..35c7791 --- /dev/null +++ b/resources/ignore-list-wrong-type-2.js @@ -0,0 +1 @@ +//# sourceMappingURL=ignore-list-wrong-type-2.js.map diff --git a/resources/ignore-list-wrong-type-2.js.map b/resources/ignore-list-wrong-type-2.js.map new file mode 100644 index 0000000..ca1d30d --- /dev/null +++ b/resources/ignore-list-wrong-type-2.js.map @@ -0,0 +1,8 @@ +{ + "version" : 3, + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "names": [], + "ignoreList": ["0"] +} diff --git a/resources/ignore-list-wrong-type-3.js b/resources/ignore-list-wrong-type-3.js new file mode 100644 index 0000000..8735d41 --- /dev/null +++ b/resources/ignore-list-wrong-type-3.js @@ -0,0 +1 @@ +//# sourceMappingURL=ignore-list-wrong-type-3.js.map diff --git a/resources/ignore-list-wrong-type-3.js.map b/resources/ignore-list-wrong-type-3.js.map new file mode 100644 index 0000000..7b4ccde --- /dev/null +++ b/resources/ignore-list-wrong-type-3.js.map @@ -0,0 +1,8 @@ +{ + "version" : 3, + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "", + "names": [], + "ignoreList": 0; +} diff --git a/resources/index-map-invalid-base-mappings.js b/resources/index-map-invalid-base-mappings.js new file mode 100644 index 0000000..e90bef0 --- /dev/null +++ b/resources/index-map-invalid-base-mappings.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-invalid-base-mappings.js.map diff --git a/resources/index-map-invalid-base-mappings.js.map b/resources/index-map-invalid-base-mappings.js.map new file mode 100644 index 0000000..b489c1f --- /dev/null +++ b/resources/index-map-invalid-base-mappings.js.map @@ -0,0 +1,15 @@ +{ + "version": 3, + "mappings": "AAAA", + "sections": [ + { + "offset": { "line": 0, "column": 0 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-invalid-order.js b/resources/index-map-invalid-order.js new file mode 100644 index 0000000..263fa3c --- /dev/null +++ b/resources/index-map-invalid-order.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-invalid-order.js.map diff --git a/resources/index-map-invalid-order.js.map b/resources/index-map-invalid-order.js.map new file mode 100644 index 0000000..82da69d --- /dev/null +++ b/resources/index-map-invalid-order.js.map @@ -0,0 +1,23 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 1, "column": 4 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + }, + { + "offset": { "line": 0, "column": 0 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-invalid-overlap.js b/resources/index-map-invalid-overlap.js new file mode 100644 index 0000000..9aff8dc --- /dev/null +++ b/resources/index-map-invalid-overlap.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-invalid-overlap.js.map diff --git a/resources/index-map-invalid-overlap.js.map b/resources/index-map-invalid-overlap.js.map new file mode 100644 index 0000000..8d42546 --- /dev/null +++ b/resources/index-map-invalid-overlap.js.map @@ -0,0 +1,23 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 0, "column": 0 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + }, + { + "offset": { "line": 0, "column": 0 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-missing-map.js b/resources/index-map-missing-map.js new file mode 100644 index 0000000..86c8e9a --- /dev/null +++ b/resources/index-map-missing-map.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-missing-map.js.map diff --git a/resources/index-map-missing-map.js.map b/resources/index-map-missing-map.js.map new file mode 100644 index 0000000..3bce47e --- /dev/null +++ b/resources/index-map-missing-map.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 0, "column": 0 } + } + ] +} diff --git a/resources/index-map-missing-offset-column.js b/resources/index-map-missing-offset-column.js new file mode 100644 index 0000000..fe69174 --- /dev/null +++ b/resources/index-map-missing-offset-column.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-missing-offset-column.js.map diff --git a/resources/index-map-missing-offset-column.js.map b/resources/index-map-missing-offset-column.js.map new file mode 100644 index 0000000..aa48bbb --- /dev/null +++ b/resources/index-map-missing-offset-column.js.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 0 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-missing-offset-line.js b/resources/index-map-missing-offset-line.js new file mode 100644 index 0000000..ba8614e --- /dev/null +++ b/resources/index-map-missing-offset-line.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-missing-offset-line.js.map diff --git a/resources/index-map-missing-offset-line.js.map b/resources/index-map-missing-offset-line.js.map new file mode 100644 index 0000000..3d60444 --- /dev/null +++ b/resources/index-map-missing-offset-line.js.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "column": 0 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-missing-offset.js b/resources/index-map-missing-offset.js new file mode 100644 index 0000000..9ca2cf3 --- /dev/null +++ b/resources/index-map-missing-offset.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-missing-offset.js.map diff --git a/resources/index-map-missing-offset.js.map b/resources/index-map-missing-offset.js.map new file mode 100644 index 0000000..7285138 --- /dev/null +++ b/resources/index-map-missing-offset.js.map @@ -0,0 +1,13 @@ +{ + "version": 3, + "sections": [ + { + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-offset-column-wrong-type.js b/resources/index-map-offset-column-wrong-type.js new file mode 100644 index 0000000..ed1e9ec --- /dev/null +++ b/resources/index-map-offset-column-wrong-type.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-offset-column-wrong-type.js.map diff --git a/resources/index-map-offset-column-wrong-type.js.map b/resources/index-map-offset-column-wrong-type.js.map new file mode 100644 index 0000000..b43e79a --- /dev/null +++ b/resources/index-map-offset-column-wrong-type.js.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 0, "column": true }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-offset-line-wrong-type.js b/resources/index-map-offset-line-wrong-type.js new file mode 100644 index 0000000..d58f2af --- /dev/null +++ b/resources/index-map-offset-line-wrong-type.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-offset-line-wrong-type.js.map diff --git a/resources/index-map-offset-line-wrong-type.js.map b/resources/index-map-offset-line-wrong-type.js.map new file mode 100644 index 0000000..81dbcd6 --- /dev/null +++ b/resources/index-map-offset-line-wrong-type.js.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": true, "column": 0 }, + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-two-concatenated-sources.js b/resources/index-map-two-concatenated-sources.js new file mode 100644 index 0000000..b8702d7 --- /dev/null +++ b/resources/index-map-two-concatenated-sources.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar();function baz(){return"baz"}baz(); +//# sourceMappingURL=index-map-two-concatenated-sources.js.map diff --git a/resources/index-map-two-concatenated-sources.js.map b/resources/index-map-two-concatenated-sources.js.map new file mode 100644 index 0000000..f5e5214 --- /dev/null +++ b/resources/index-map-two-concatenated-sources.js.map @@ -0,0 +1,23 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 0, "column": 0 }, + "map": { + "version": 3, + "names": ["foo","bar"], + "sources": ["basic-mapping-original.js"], + "mappings": "AAAA,SAASA,MACP,OAAO,EACT,CACA,SAASC,MACP,OAAO,EACT,CACAD,MACAC" + } + }, + { + "offset": { "line": 0, "column": 62 }, + "map": { + "version": 3, + "names": ["baz"], + "sources": ["second-source-original.js"], + "mappings":"AAAA,SAASA,MACP,MAAO,KACT,CACAA" + } + } + ] +} diff --git a/resources/index-map-wrong-type-map.js b/resources/index-map-wrong-type-map.js new file mode 100644 index 0000000..d31d6d6 --- /dev/null +++ b/resources/index-map-wrong-type-map.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-wrong-type-map.js.map diff --git a/resources/index-map-wrong-type-map.js.map b/resources/index-map-wrong-type-map.js.map new file mode 100644 index 0000000..0963f62 --- /dev/null +++ b/resources/index-map-wrong-type-map.js.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "sections": [ + { + "offset": { "line": 0, "column": 0 }, + "map": "not a map" + } + ] +} diff --git a/resources/index-map-wrong-type-offset.js b/resources/index-map-wrong-type-offset.js new file mode 100644 index 0000000..048e124 --- /dev/null +++ b/resources/index-map-wrong-type-offset.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-wrong-type-offset.js.map diff --git a/resources/index-map-wrong-type-offset.js.map b/resources/index-map-wrong-type-offset.js.map new file mode 100644 index 0000000..fbc6e4e --- /dev/null +++ b/resources/index-map-wrong-type-offset.js.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "sections": [ + { + "offset": "not an offset", + "map": { + "version": 3, + "names": [], + "sources": ["empty-original.js"], + "mappings": "AAAA" + } + } + ] +} diff --git a/resources/index-map-wrong-type-sections.js b/resources/index-map-wrong-type-sections.js new file mode 100644 index 0000000..011eca8 --- /dev/null +++ b/resources/index-map-wrong-type-sections.js @@ -0,0 +1 @@ +//# sourceMappingURL=index-map-wrong-type-sections.js.map diff --git a/resources/index-map-wrong-type-sections.js.map b/resources/index-map-wrong-type-sections.js.map new file mode 100644 index 0000000..dbfb4ea --- /dev/null +++ b/resources/index-map-wrong-type-sections.js.map @@ -0,0 +1,4 @@ +{ + "version": 3, + "sections": "not a sections list" +} diff --git a/resources/invalid-mapping-bad-separator.js b/resources/invalid-mapping-bad-separator.js new file mode 100644 index 0000000..25338ac --- /dev/null +++ b/resources/invalid-mapping-bad-separator.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar(); +//# sourceMappingURL=invalid-mapping-bad-separator.js.map diff --git a/resources/invalid-mapping-bad-separator.js.map b/resources/invalid-mapping-bad-separator.js.map new file mode 100644 index 0000000..5f4f5b9 --- /dev/null +++ b/resources/invalid-mapping-bad-separator.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "names": ["foo","bar"], + "sources": ["basic-mapping-original.js"], + "mappings": "AAAA.SAASA:MACP" +} diff --git a/resources/invalid-mapping-not-a-string-1.js b/resources/invalid-mapping-not-a-string-1.js new file mode 100644 index 0000000..cb38e2f --- /dev/null +++ b/resources/invalid-mapping-not-a-string-1.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-not-a-string-1.js.map diff --git a/resources/invalid-mapping-not-a-string-1.js.map b/resources/invalid-mapping-not-a-string-1.js.map new file mode 100644 index 0000000..5bf3e2a --- /dev/null +++ b/resources/invalid-mapping-not-a-string-1.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-not-a-string-1.js", + "sources": ["empty-original.js"], + "mappings": 5 +} diff --git a/resources/invalid-mapping-not-a-string-2.js b/resources/invalid-mapping-not-a-string-2.js new file mode 100644 index 0000000..3d84abd --- /dev/null +++ b/resources/invalid-mapping-not-a-string-2.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-not-a-string-2.js.map diff --git a/resources/invalid-mapping-not-a-string-2.js.map b/resources/invalid-mapping-not-a-string-2.js.map new file mode 100644 index 0000000..4527e7f --- /dev/null +++ b/resources/invalid-mapping-not-a-string-2.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-not-a-string-2.js", + "sources": ["empty-original.js"], + "mappings": [1, 2, 3, 4] +} diff --git a/resources/invalid-mapping-segment-column-too-large.js b/resources/invalid-mapping-segment-column-too-large.js new file mode 100644 index 0000000..55591f8 --- /dev/null +++ b/resources/invalid-mapping-segment-column-too-large.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-column-too-large.js.map diff --git a/resources/invalid-mapping-segment-column-too-large.js.map b/resources/invalid-mapping-segment-column-too-large.js.map new file mode 100644 index 0000000..b4c059e --- /dev/null +++ b/resources/invalid-mapping-segment-column-too-large.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-column-too-large.js", + "sources": ["empty-original.js"], + "mappings": "ggggggE" +} diff --git a/resources/invalid-mapping-segment-name-index-out-of-bounds.js b/resources/invalid-mapping-segment-name-index-out-of-bounds.js new file mode 100644 index 0000000..2a6b434 --- /dev/null +++ b/resources/invalid-mapping-segment-name-index-out-of-bounds.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-name-index-out-of-bounds.js.map diff --git a/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map b/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map new file mode 100644 index 0000000..8dd2ea6 --- /dev/null +++ b/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": ["foo"], + "file": "invalid-mapping-segment-name-index-out-of-bounds.js", + "sources": ["empty-original.js"], + "mappings": "AAAAC" +} diff --git a/resources/invalid-mapping-segment-name-index-too-large.js b/resources/invalid-mapping-segment-name-index-too-large.js new file mode 100644 index 0000000..709e34d --- /dev/null +++ b/resources/invalid-mapping-segment-name-index-too-large.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-name-index-too-large.js.map diff --git a/resources/invalid-mapping-segment-name-index-too-large.js.map b/resources/invalid-mapping-segment-name-index-too-large.js.map new file mode 100644 index 0000000..c7bf5b9 --- /dev/null +++ b/resources/invalid-mapping-segment-name-index-too-large.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-name-index-too-large.js", + "sources": ["empty-original.js"], + "mappings": "AAAAggggggE" +} diff --git a/resources/invalid-mapping-segment-negative-column.js b/resources/invalid-mapping-segment-negative-column.js new file mode 100644 index 0000000..a202152 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-column.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-column.js.map diff --git a/resources/invalid-mapping-segment-negative-column.js.map b/resources/invalid-mapping-segment-negative-column.js.map new file mode 100644 index 0000000..403878b --- /dev/null +++ b/resources/invalid-mapping-segment-negative-column.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-column.js", + "sources": ["empty-original.js"], + "mappings": "F" +} diff --git a/resources/invalid-mapping-segment-negative-name-index.js b/resources/invalid-mapping-segment-negative-name-index.js new file mode 100644 index 0000000..3e3f634 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-name-index.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-name-index.js.map diff --git a/resources/invalid-mapping-segment-negative-name-index.js.map b/resources/invalid-mapping-segment-negative-name-index.js.map new file mode 100644 index 0000000..b94f636 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-name-index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-name-index.js", + "sources": ["empty-original.js"], + "mappings": "AAAAF" +} diff --git a/resources/invalid-mapping-segment-negative-original-column.js b/resources/invalid-mapping-segment-negative-original-column.js new file mode 100644 index 0000000..f21d534 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-original-column.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-original-column.js.map diff --git a/resources/invalid-mapping-segment-negative-original-column.js.map b/resources/invalid-mapping-segment-negative-original-column.js.map new file mode 100644 index 0000000..011c639 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-original-column.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-original-column.js", + "sources": ["empty-original.js"], + "mappings": "AAAF" +} diff --git a/resources/invalid-mapping-segment-negative-original-line.js b/resources/invalid-mapping-segment-negative-original-line.js new file mode 100644 index 0000000..b373096 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-original-line.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-original-line.js.map diff --git a/resources/invalid-mapping-segment-negative-original-line.js.map b/resources/invalid-mapping-segment-negative-original-line.js.map new file mode 100644 index 0000000..e7ec993 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-original-line.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-original-line.js", + "sources": ["empty-original.js"], + "mappings": "AAFA" +} diff --git a/resources/invalid-mapping-segment-negative-relative-column.js b/resources/invalid-mapping-segment-negative-relative-column.js new file mode 100644 index 0000000..94b835d --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-column.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-relative-column.js.map diff --git a/resources/invalid-mapping-segment-negative-relative-column.js.map b/resources/invalid-mapping-segment-negative-relative-column.js.map new file mode 100644 index 0000000..4148840 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-column.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-relative-column.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "C,F" +} diff --git a/resources/invalid-mapping-segment-negative-relative-name-index.js b/resources/invalid-mapping-segment-negative-relative-name-index.js new file mode 100644 index 0000000..c965c5f --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-name-index.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-relative-name-index.js.map diff --git a/resources/invalid-mapping-segment-negative-relative-name-index.js.map b/resources/invalid-mapping-segment-negative-relative-name-index.js.map new file mode 100644 index 0000000..1fbbcfc --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-name-index.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-relative-name-index.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "AAAAC,AAAAF" +} diff --git a/resources/invalid-mapping-segment-negative-relative-original-column.js b/resources/invalid-mapping-segment-negative-relative-original-column.js new file mode 100644 index 0000000..493a6ec --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-original-column.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-relative-original-column.js.map diff --git a/resources/invalid-mapping-segment-negative-relative-original-column.js.map b/resources/invalid-mapping-segment-negative-relative-original-column.js.map new file mode 100644 index 0000000..7e62895 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-original-column.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-relative-original-column.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "AAAC,AAAF" +} diff --git a/resources/invalid-mapping-segment-negative-relative-original-line.js b/resources/invalid-mapping-segment-negative-relative-original-line.js new file mode 100644 index 0000000..ca8329f --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-original-line.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-relative-original-line.js.map diff --git a/resources/invalid-mapping-segment-negative-relative-original-line.js.map b/resources/invalid-mapping-segment-negative-relative-original-line.js.map new file mode 100644 index 0000000..86b0fb3 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-original-line.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-relative-original-line.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "AACA,AAFA" +} diff --git a/resources/invalid-mapping-segment-negative-relative-source-index.js b/resources/invalid-mapping-segment-negative-relative-source-index.js new file mode 100644 index 0000000..fa92225 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-source-index.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-relative-source-index.js.map diff --git a/resources/invalid-mapping-segment-negative-relative-source-index.js.map b/resources/invalid-mapping-segment-negative-relative-source-index.js.map new file mode 100644 index 0000000..2efeb04 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-relative-source-index.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-relative-source-index.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": "ACAA,AFAA" +} diff --git a/resources/invalid-mapping-segment-negative-source-index.js b/resources/invalid-mapping-segment-negative-source-index.js new file mode 100644 index 0000000..6e05849 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-source-index.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-negative-source-index.js.map diff --git a/resources/invalid-mapping-segment-negative-source-index.js.map b/resources/invalid-mapping-segment-negative-source-index.js.map new file mode 100644 index 0000000..596c2f2 --- /dev/null +++ b/resources/invalid-mapping-segment-negative-source-index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-negative-source-index.js", + "sources": ["empty-original.js"], + "mappings": "AFAA" +} diff --git a/resources/invalid-mapping-segment-original-column-too-large.js b/resources/invalid-mapping-segment-original-column-too-large.js new file mode 100644 index 0000000..0936ed7 --- /dev/null +++ b/resources/invalid-mapping-segment-original-column-too-large.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-original-column-too-large.js.map diff --git a/resources/invalid-mapping-segment-original-column-too-large.js.map b/resources/invalid-mapping-segment-original-column-too-large.js.map new file mode 100644 index 0000000..ff2103f --- /dev/null +++ b/resources/invalid-mapping-segment-original-column-too-large.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-original-column-too-large.js", + "sources": ["empty-original.js"], + "mappings": "AAAggggggE" +} diff --git a/resources/invalid-mapping-segment-original-line-too-large.js b/resources/invalid-mapping-segment-original-line-too-large.js new file mode 100644 index 0000000..9b3aa5a --- /dev/null +++ b/resources/invalid-mapping-segment-original-line-too-large.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-original-line-too-large.js.map diff --git a/resources/invalid-mapping-segment-original-line-too-large.js.map b/resources/invalid-mapping-segment-original-line-too-large.js.map new file mode 100644 index 0000000..890f1c7 --- /dev/null +++ b/resources/invalid-mapping-segment-original-line-too-large.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-original-line-too-large.js", + "sources": ["empty-original.js"], + "mappings": "AAggggggEA" +} diff --git a/resources/invalid-mapping-segment-source-index-out-of-bounds.js b/resources/invalid-mapping-segment-source-index-out-of-bounds.js new file mode 100644 index 0000000..2e5fbca --- /dev/null +++ b/resources/invalid-mapping-segment-source-index-out-of-bounds.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-source-index-out-of-bounds.js.map diff --git a/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map b/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map new file mode 100644 index 0000000..86dedb1 --- /dev/null +++ b/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-source-index-out-of-bounds.js", + "sources": ["empty-original.js"], + "mappings": "ACAA" +} diff --git a/resources/invalid-mapping-segment-source-index-too-large.js b/resources/invalid-mapping-segment-source-index-too-large.js new file mode 100644 index 0000000..3f4943e --- /dev/null +++ b/resources/invalid-mapping-segment-source-index-too-large.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-source-index-too-large.js.map diff --git a/resources/invalid-mapping-segment-source-index-too-large.js.map b/resources/invalid-mapping-segment-source-index-too-large.js.map new file mode 100644 index 0000000..e9f858c --- /dev/null +++ b/resources/invalid-mapping-segment-source-index-too-large.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-source-index-too-large.js", + "sources": ["empty-original.js"], + "mappings": "AggggggEAA" +} diff --git a/resources/invalid-mapping-segment-with-three-fields.js b/resources/invalid-mapping-segment-with-three-fields.js new file mode 100644 index 0000000..4b868fa --- /dev/null +++ b/resources/invalid-mapping-segment-with-three-fields.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar(); +//# sourceMappingURL=invalid-mapping-three-fields.js.map diff --git a/resources/invalid-mapping-segment-with-three-fields.js.map b/resources/invalid-mapping-segment-with-three-fields.js.map new file mode 100644 index 0000000..c2af116 --- /dev/null +++ b/resources/invalid-mapping-segment-with-three-fields.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "names": ["foo","bar"], + "sources": ["basic-mapping-original.js"], + "mappings": "AAA" +} diff --git a/resources/invalid-mapping-segment-with-two-fields.js b/resources/invalid-mapping-segment-with-two-fields.js new file mode 100644 index 0000000..96045a7 --- /dev/null +++ b/resources/invalid-mapping-segment-with-two-fields.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar(); +//# sourceMappingURL=invalid-mapping-two-fields.js.map diff --git a/resources/invalid-mapping-segment-with-two-fields.js.map b/resources/invalid-mapping-segment-with-two-fields.js.map new file mode 100644 index 0000000..73cf00f --- /dev/null +++ b/resources/invalid-mapping-segment-with-two-fields.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "names": ["foo","bar"], + "sources": ["basic-mapping-original.js"], + "mappings": "AA" +} diff --git a/resources/invalid-mapping-segment-with-zero-fields.js b/resources/invalid-mapping-segment-with-zero-fields.js new file mode 100644 index 0000000..9d5332a --- /dev/null +++ b/resources/invalid-mapping-segment-with-zero-fields.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-mapping-segment-column-with-zero-fields.js.map diff --git a/resources/invalid-mapping-segment-with-zero-fields.js.map b/resources/invalid-mapping-segment-with-zero-fields.js.map new file mode 100644 index 0000000..5a34d25 --- /dev/null +++ b/resources/invalid-mapping-segment-with-zero-fields.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": [], + "file": "invalid-mapping-segment-with-zero-fields.js", + "sources": ["empty-original.js"], + "mappings": ",,,," +} diff --git a/resources/invalid-vlq-missing-continuation.js b/resources/invalid-vlq-missing-continuation.js new file mode 100644 index 0000000..2c2a009 --- /dev/null +++ b/resources/invalid-vlq-missing-continuation.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-vlq-missing-continuation.js.map diff --git a/resources/invalid-vlq-missing-continuation.js.map b/resources/invalid-vlq-missing-continuation.js.map new file mode 100644 index 0000000..dd0e363 --- /dev/null +++ b/resources/invalid-vlq-missing-continuation.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": [], + "names": [], + "mappings": "g" +} diff --git a/resources/invalid-vlq-non-base64-char.js b/resources/invalid-vlq-non-base64-char.js new file mode 100644 index 0000000..d1b20b4 --- /dev/null +++ b/resources/invalid-vlq-non-base64-char.js @@ -0,0 +1 @@ +//# sourceMappingURL=invalid-vlq-non-base64-char.js.map diff --git a/resources/invalid-vlq-non-base64-char.js.map b/resources/invalid-vlq-non-base64-char.js.map new file mode 100644 index 0000000..4fa1ac5 --- /dev/null +++ b/resources/invalid-vlq-non-base64-char.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": [], + "names": [], + "mappings": "A$%?!" +} diff --git a/resources/names-missing.js b/resources/names-missing.js new file mode 100644 index 0000000..58781fd --- /dev/null +++ b/resources/names-missing.js @@ -0,0 +1 @@ +//# sourceMappingURL=names-missing.js.map diff --git a/resources/names-missing.js.map b/resources/names-missing.js.map new file mode 100644 index 0000000..82170bf --- /dev/null +++ b/resources/names-missing.js.map @@ -0,0 +1,5 @@ +{ + "version" : 3, + "sources": ["empty-original.js"], + "mappings": "" +} diff --git a/resources/names-not-a-list-1.js b/resources/names-not-a-list-1.js new file mode 100644 index 0000000..dc65f19 --- /dev/null +++ b/resources/names-not-a-list-1.js @@ -0,0 +1 @@ +//# sourceMappingURL=names-not-a-list-1.js.map diff --git a/resources/names-not-a-list-1.js.map b/resources/names-not-a-list-1.js.map new file mode 100644 index 0000000..fe1edae --- /dev/null +++ b/resources/names-not-a-list-1.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": ["source.js"], + "names": "not a list", + "mappings": "AAAAA" +} diff --git a/resources/names-not-a-list-2.js b/resources/names-not-a-list-2.js new file mode 100644 index 0000000..d7251f7 --- /dev/null +++ b/resources/names-not-a-list-2.js @@ -0,0 +1 @@ +//# sourceMappingURL=names-not-a-list-2.js.map diff --git a/resources/names-not-a-list-2.js.map b/resources/names-not-a-list-2.js.map new file mode 100644 index 0000000..3388d2b --- /dev/null +++ b/resources/names-not-a-list-2.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": ["source.js"], + "names": { "foo": 3 }, + "mappings": "AAAAA" +} diff --git a/resources/names-not-string.js b/resources/names-not-string.js new file mode 100644 index 0000000..8dc7b48 --- /dev/null +++ b/resources/names-not-string.js @@ -0,0 +1 @@ +//# sourceMappingURL=names-not-string.js.map diff --git a/resources/names-not-string.js.map b/resources/names-not-string.js.map new file mode 100644 index 0000000..c0feb07 --- /dev/null +++ b/resources/names-not-string.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": ["source.js"], + "names": [null, 3, true, false, {}, []], + "mappings": "AAAAA" +} diff --git a/resources/second-source-original.js b/resources/second-source-original.js new file mode 100644 index 0000000..c339bc9 --- /dev/null +++ b/resources/second-source-original.js @@ -0,0 +1,4 @@ +function baz() { + return "baz"; +} +baz(); diff --git a/resources/sources-and-sources-content-both-null.js b/resources/sources-and-sources-content-both-null.js new file mode 100644 index 0000000..9263eba --- /dev/null +++ b/resources/sources-and-sources-content-both-null.js @@ -0,0 +1 @@ +//# sourceMappingURL=sources-and-sources-content-both-null.js.map diff --git a/resources/sources-and-sources-content-both-null.js.map b/resources/sources-and-sources-content-both-null.js.map new file mode 100644 index 0000000..09a7c1f --- /dev/null +++ b/resources/sources-and-sources-content-both-null.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": ["foo"], + "sources": [null], + "sourcesContent": [null], + "mappings":"AAAA,SAASA" +} diff --git a/resources/sources-missing.js b/resources/sources-missing.js new file mode 100644 index 0000000..779b865 --- /dev/null +++ b/resources/sources-missing.js @@ -0,0 +1 @@ +//# sourceMappingURL=sources-missing.js.map diff --git a/resources/sources-missing.js.map b/resources/sources-missing.js.map new file mode 100644 index 0000000..92aff4f --- /dev/null +++ b/resources/sources-missing.js.map @@ -0,0 +1,5 @@ +{ + "version" : 3, + "names": ["foo"], + "mappings": "" +} diff --git a/resources/sources-non-null-sources-content-null.js b/resources/sources-non-null-sources-content-null.js new file mode 100644 index 0000000..939b568 --- /dev/null +++ b/resources/sources-non-null-sources-content-null.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar(); +//# sourceMappingURL=sources-non-null-sources-content-null.js.map diff --git a/resources/sources-non-null-sources-content-null.js.map b/resources/sources-non-null-sources-content-null.js.map new file mode 100644 index 0000000..e573906 --- /dev/null +++ b/resources/sources-non-null-sources-content-null.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": ["foo"], + "sources": ["basic-mapping-original.js"], + "sourcesContent": [null], + "mappings":"AAAA,SAASA" +} diff --git a/resources/sources-not-a-list-1.js b/resources/sources-not-a-list-1.js new file mode 100644 index 0000000..7e33b7e --- /dev/null +++ b/resources/sources-not-a-list-1.js @@ -0,0 +1 @@ +//# sourceMappingURL=sources-not-a-list-1.js.map diff --git a/resources/sources-not-a-list-1.js.map b/resources/sources-not-a-list-1.js.map new file mode 100644 index 0000000..2633051 --- /dev/null +++ b/resources/sources-not-a-list-1.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": "not a list", + "names": ["foo"], + "mappings": "AAAAA" +} diff --git a/resources/sources-not-a-list-2.js b/resources/sources-not-a-list-2.js new file mode 100644 index 0000000..4021f76 --- /dev/null +++ b/resources/sources-not-a-list-2.js @@ -0,0 +1 @@ +//# sourceMappingURL=sources-not-a-list-2.js.map diff --git a/resources/sources-not-a-list-2.js.map b/resources/sources-not-a-list-2.js.map new file mode 100644 index 0000000..2ed8596 --- /dev/null +++ b/resources/sources-not-a-list-2.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": { "source.js": 3 }, + "names": ["foo"], + "mappings": "AAAAA" +} diff --git a/resources/sources-not-string-or-null.js b/resources/sources-not-string-or-null.js new file mode 100644 index 0000000..7dca97a --- /dev/null +++ b/resources/sources-not-string-or-null.js @@ -0,0 +1 @@ +//# sourceMappingURL=sources-not-string-or-null.js.map diff --git a/resources/sources-not-string-or-null.js.map b/resources/sources-not-string-or-null.js.map new file mode 100644 index 0000000..db25561 --- /dev/null +++ b/resources/sources-not-string-or-null.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": [3, {}, true, false, []], + "names": ["foo"], + "mappings": "AAAAA" +} diff --git a/resources/sources-null-sources-content-non-null.js b/resources/sources-null-sources-content-non-null.js new file mode 100644 index 0000000..a760594 --- /dev/null +++ b/resources/sources-null-sources-content-non-null.js @@ -0,0 +1,2 @@ +function foo(){return 42}function bar(){return 24}foo();bar(); +//# sourceMappingURL=sources-null-sources-content-non-null.js.map diff --git a/resources/sources-null-sources-content-non-null.js.map b/resources/sources-null-sources-content-non-null.js.map new file mode 100644 index 0000000..43af039 --- /dev/null +++ b/resources/sources-null-sources-content-non-null.js.map @@ -0,0 +1,7 @@ +{ + "version":3, + "names": ["foo"], + "sources": [null], + "sourcesContent": ["function foo()\n{ return 42; }\nfunction bar()\n { return 24; }\nfoo();\nbar();"], + "mappings":"AAAA,SAASA" +} diff --git a/resources/transitive-mapping-original.js b/resources/transitive-mapping-original.js new file mode 100644 index 0000000..0a96699 --- /dev/null +++ b/resources/transitive-mapping-original.js @@ -0,0 +1,5 @@ +function foo(x) { + return x; +} +foo("foo"); +//# sourceMappingURL=transitive-mapping-original.js.map diff --git a/resources/transitive-mapping-original.js.map b/resources/transitive-mapping-original.js.map new file mode 100644 index 0000000..65af25c --- /dev/null +++ b/resources/transitive-mapping-original.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "file" : "transitive-mapping-original.js", + "sourceRoot": "", + "sources": ["typescript-original.ts"], + "names": [], + "mappings": "AACA,SAAS,GAAG,CAAC,CAAU;IACrB,OAAO,CAAC,CAAC;AACX,CAAC;AACD,GAAG,CAAC,KAAK,CAAC,CAAC" +} diff --git a/resources/transitive-mapping-three-steps.js b/resources/transitive-mapping-three-steps.js new file mode 100644 index 0000000..fd95616 --- /dev/null +++ b/resources/transitive-mapping-three-steps.js @@ -0,0 +1,6 @@ +function foo(x) { + return x; +} + +foo("foo"); +//# sourceMappingURL=transitive-mapping-three-steps.js.map diff --git a/resources/transitive-mapping-three-steps.js.map b/resources/transitive-mapping-three-steps.js.map new file mode 100644 index 0000000..90459d9 --- /dev/null +++ b/resources/transitive-mapping-three-steps.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "file": "transitive-mapping-three-steps.js", + "sources": ["transitive-mapping.js"], + "names": ["foo", "x"], + "mappings": "AAAA,SAASA,IAAIC;IAAG,OAAOA;AAAC;;AAACD,IAAI,KAAK" +} diff --git a/resources/transitive-mapping.js b/resources/transitive-mapping.js new file mode 100644 index 0000000..183c027 --- /dev/null +++ b/resources/transitive-mapping.js @@ -0,0 +1,2 @@ +function foo(x){return x}foo("foo"); +//# sourceMappingURL=transitive-mapping.js.map diff --git a/resources/transitive-mapping.js.map b/resources/transitive-mapping.js.map new file mode 100644 index 0000000..d6a6fa6 --- /dev/null +++ b/resources/transitive-mapping.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "names": ["foo","x"], + "sources": ["transitive-mapping-original.js"], + "mappings":"AAAA,SAASA,IAAIC,GACT,OAAOA,CACX,CACAD,IAAI" +} diff --git a/resources/typescript-original.ts b/resources/typescript-original.ts new file mode 100644 index 0000000..cd51c01 --- /dev/null +++ b/resources/typescript-original.ts @@ -0,0 +1,5 @@ +type FooArg = string | number; +function foo(x : FooArg) { + return x; +} +foo("foo"); diff --git a/resources/unrecognized-property.js b/resources/unrecognized-property.js new file mode 100644 index 0000000..19dfb0e --- /dev/null +++ b/resources/unrecognized-property.js @@ -0,0 +1 @@ +//# sourceMappingURL=unrecognized-property.js.map diff --git a/resources/unrecognized-property.js.map b/resources/unrecognized-property.js.map new file mode 100644 index 0000000..40bee55 --- /dev/null +++ b/resources/unrecognized-property.js.map @@ -0,0 +1,8 @@ +{ + "version" : 3, + "sources": [], + "names": [], + "mappings": "", + "foobar": 42, + "unusedProperty": [1, 2, 3, 4] +} diff --git a/resources/valid-mapping-boundary-values.js b/resources/valid-mapping-boundary-values.js new file mode 100644 index 0000000..3c49709 --- /dev/null +++ b/resources/valid-mapping-boundary-values.js @@ -0,0 +1 @@ +//# sourceMappingURL=valid-mapping-boundary-values.js.map diff --git a/resources/valid-mapping-boundary-values.js.map b/resources/valid-mapping-boundary-values.js.map new file mode 100644 index 0000000..4dd836e --- /dev/null +++ b/resources/valid-mapping-boundary-values.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "names": ["foo"], + "file": "valid-mapping-boundary-values.js", + "sources": ["empty-original.js"], + "mappings": "+/////DA+/////D+/////DA" +} diff --git a/resources/valid-mapping-empty-groups.js b/resources/valid-mapping-empty-groups.js new file mode 100644 index 0000000..a2b767b --- /dev/null +++ b/resources/valid-mapping-empty-groups.js @@ -0,0 +1 @@ +//# sourceMappingURL=valid-mapping-empty-groups.js.map diff --git a/resources/valid-mapping-empty-groups.js.map b/resources/valid-mapping-empty-groups.js.map new file mode 100644 index 0000000..643c9ae --- /dev/null +++ b/resources/valid-mapping-empty-groups.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "names": [], + "file": "valid-mapping-empty-groups.js", + "sources": ["empty-original.js"], + "sourcesContent": [""], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" +} diff --git a/resources/valid-mapping-large-vlq.js b/resources/valid-mapping-large-vlq.js new file mode 100644 index 0000000..b0cd897 --- /dev/null +++ b/resources/valid-mapping-large-vlq.js @@ -0,0 +1 @@ +//# sourceMappingURL=valid-mapping-large-vlq.js.map diff --git a/resources/valid-mapping-large-vlq.js.map b/resources/valid-mapping-large-vlq.js.map new file mode 100644 index 0000000..76e1870 --- /dev/null +++ b/resources/valid-mapping-large-vlq.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "names": [], + "sources": ["valid-mapping-large-vlq.js"], + "mappings": "igggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggA" +} diff --git a/resources/version-missing.js b/resources/version-missing.js new file mode 100644 index 0000000..c32d1f1 --- /dev/null +++ b/resources/version-missing.js @@ -0,0 +1 @@ +//# sourceMappingURL=version-missing.js.map diff --git a/resources/version-missing.js.map b/resources/version-missing.js.map new file mode 100644 index 0000000..49d8ce7 --- /dev/null +++ b/resources/version-missing.js.map @@ -0,0 +1,5 @@ +{ + "sources": [], + "names": [], + "mappings": "" +} diff --git a/resources/version-not-a-number.js b/resources/version-not-a-number.js new file mode 100644 index 0000000..ae2342e --- /dev/null +++ b/resources/version-not-a-number.js @@ -0,0 +1 @@ +//# sourceMappingURL=version-not-a-number.js.map diff --git a/resources/version-not-a-number.js.map b/resources/version-not-a-number.js.map new file mode 100644 index 0000000..a584d6e --- /dev/null +++ b/resources/version-not-a-number.js.map @@ -0,0 +1,6 @@ +{ + "version" : "3foo", + "sources": [], + "names": [], + "mappings": "" +} diff --git a/resources/version-numeric-string.js b/resources/version-numeric-string.js new file mode 100644 index 0000000..a551708 --- /dev/null +++ b/resources/version-numeric-string.js @@ -0,0 +1 @@ +//# sourceMappingURL=version-numeric-string.js.map diff --git a/resources/version-numeric-string.js.map b/resources/version-numeric-string.js.map new file mode 100644 index 0000000..dbe52a7 --- /dev/null +++ b/resources/version-numeric-string.js.map @@ -0,0 +1,6 @@ +{ + "version" : "3", + "sources": [], + "names": [], + "mappings": "" +} diff --git a/resources/version-too-high.js b/resources/version-too-high.js new file mode 100644 index 0000000..55f4e1a --- /dev/null +++ b/resources/version-too-high.js @@ -0,0 +1 @@ +//# sourceMappingURL=version-too-high.js.map diff --git a/resources/version-too-high.js.map b/resources/version-too-high.js.map new file mode 100644 index 0000000..ee23be3 --- /dev/null +++ b/resources/version-too-high.js.map @@ -0,0 +1,6 @@ +{ + "version" : 4, + "sources": [], + "names": [], + "mappings": "" +} diff --git a/resources/version-too-low.js b/resources/version-too-low.js new file mode 100644 index 0000000..d964292 --- /dev/null +++ b/resources/version-too-low.js @@ -0,0 +1 @@ +//# sourceMappingURL=version-too-low.js.map diff --git a/resources/version-too-low.js.map b/resources/version-too-low.js.map new file mode 100644 index 0000000..64ca7a6 --- /dev/null +++ b/resources/version-too-low.js.map @@ -0,0 +1,6 @@ +{ + "version" : 2, + "sources": [], + "names": [], + "mappings": "" +} diff --git a/resources/version-valid.js b/resources/version-valid.js new file mode 100644 index 0000000..82d0bfa --- /dev/null +++ b/resources/version-valid.js @@ -0,0 +1 @@ +//# sourceMappingURL=version-valid.js.map diff --git a/resources/version-valid.js.map b/resources/version-valid.js.map new file mode 100644 index 0000000..1a16305 --- /dev/null +++ b/resources/version-valid.js.map @@ -0,0 +1,6 @@ +{ + "version" : 3, + "sources": [], + "names": [], + "mappings": "" +} diff --git a/source-map-spec-tests.json b/source-map-spec-tests.json new file mode 100644 index 0000000..d4ec5aa --- /dev/null +++ b/source-map-spec-tests.json @@ -0,0 +1,1081 @@ +{ + "tests": [ + { + "name": "versionValid", + "description": "Test a simple source map with a valid version number", + "baseFile": "version-valid.js", + "sourceMapFile": "version-valid.js.map", + "sourceMapIsValid": true + }, + { + "name": "versionMissing", + "description": "Test a source map that is missing a version field", + "baseFile": "version-missing.js", + "sourceMapFile": "version-missing.js.map", + "sourceMapIsValid": false + }, + { + "name": "versionNotANumber", + "description": "Test a source map with a version field that is not a number", + "baseFile": "version-not-a-number.js", + "sourceMapFile": "version-not-a-number.js.map", + "sourceMapIsValid": false + }, + { + "name": "versionNumericString", + "description": "Test a source map with a version field that is a number as a string", + "baseFile": "version-numeric-string.js", + "sourceMapFile": "version-numeric-string.js.map", + "sourceMapIsValid": false + }, + { + "name": "versionTooHigh", + "description": "Test a source map with an integer version field that is too high", + "baseFile": "version-too-high.js", + "sourceMapFile": "version-too-high.js.map", + "sourceMapIsValid": false + }, + { + "name": "versionTooLow", + "description": "Test a source map with an integer version field that is too low", + "baseFile": "version-too-low.js", + "sourceMapFile": "version-too-low.js.map", + "sourceMapIsValid": false + }, + { + "name": "sourcesMissing", + "description": "Test a source map that is missing a necessary sources field", + "baseFile": "sources-missing.js", + "sourceMapFile": "sources-missing.js.map", + "sourceMapIsValid": false + }, + { + "name": "sourcesNotAList1", + "description": "Test a source map with a sources field that is not a valid list (string)", + "baseFile": "sources-not-a-list-1.js", + "sourceMapFile": "sources-not-a-list-1.js.map", + "sourceMapIsValid": false + }, + { + "name": "sourcesNotAList2", + "description": "Test a source map with a sources field that is not a valid list (object)", + "baseFile": "sources-not-a-list-2.js", + "sourceMapFile": "sources-not-a-list-2.js.map", + "sourceMapIsValid": false + }, + { + "name": "sourcesNotStringOrNull", + "description": "Test a source map with a sources list that has non-string and non-null items", + "baseFile": "sources-not-string-or-null.js", + "sourceMapFile": "sources-not-string-or-null.js.map", + "sourceMapIsValid": false + }, + { + "name": "sourcesAndSourcesContentBothNull", + "description": "Test a source map that has both null sources and sourcesContent entries", + "baseFile": "sources-and-sources-content-both-null.js", + "sourceMapFile": "sources-and-sources-content-both-null.js.map", + "sourceMapIsValid": true + }, + { + "name": "namesMissing", + "description": "Test a source map that is missing a necessary names field", + "baseFile": "names-missing.js", + "sourceMapFile": "names-missing.js.map", + "sourceMapIsValid": false + }, + { + "name": "namesNotAList1", + "description": "Test a source map with a names field that is not a valid list (string)", + "baseFile": "names-not-a-list-1.js", + "sourceMapFile": "names-not-a-list-1.js.map", + "sourceMapIsValid": false + }, + { + "name": "namesNotAList2", + "description": "Test a source map with a names field that is not a valid list (object)", + "baseFile": "names-not-a-list-2.js", + "sourceMapFile": "names-not-a-list-2.js.map", + "sourceMapIsValid": false + }, + { + "name": "namesNotString", + "description": "Test a source map with a names list that has non-string items", + "baseFile": "names-not-string.js", + "sourceMapFile": "names-not-string.js.map", + "sourceMapIsValid": false + }, + { + "name": "ignoreListEmpty", + "description": "Test a source map with an ignore list that has no items", + "baseFile": "ignore-list-empty.js", + "sourceMapFile": "ignore-list-empty.js.map", + "sourceMapIsValid": true + }, + { + "name": "ignoreListValid1", + "description": "Test a source map with a simple valid ignore list", + "baseFile": "ignore-list-valid-1.js", + "sourceMapFile": "ignore-list-valid-1.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkIgnoreList", + "present": ["empty-original.js"] + } + ] + }, + { + "name": "ignoreListWrongType1", + "description": "Test a source map with an ignore list with the wrong type of items", + "baseFile": "ignore-list-wrong-type-1.js", + "sourceMapFile": "ignore-list-wrong-type-1.js.map", + "sourceMapIsValid": false + }, + { + "name": "ignoreListWrongType2", + "description": "Test a source map with an ignore list with the wrong type of items", + "baseFile": "ignore-list-wrong-type-2.js", + "sourceMapFile": "ignore-list-wrong-type-2.js.map", + "sourceMapIsValid": false + }, + { + "name": "ignoreListWrongType3", + "description": "Test a source map with an ignore list that is not a list", + "baseFile": "ignore-list-wrong-type-3.js", + "sourceMapFile": "ignore-list-wrong-type-3.js.map", + "sourceMapIsValid": false + }, + { + "name": "ignoreListOutOfBounds", + "description": "Test a source map with an ignore list with an item with an out-of-bounds index", + "baseFile": "ignore-list-out-of-bounds.js", + "sourceMapFile": "ignore-list-out-of-bounds.js.map", + "sourceMapIsValid": false + }, + { + "name": "unrecognizedProperty", + "description": "Test a source map that has an extra field not explicitly encoded in the spec", + "baseFile": "unrecognized-property.js", + "sourceMapFile": "unrecognized-property.js.map", + "sourceMapIsValid": true + }, + { + "name": "invalidVLQDueToNonBase64Character", + "description": "Test a source map that has a mapping with an invalid non-base64 character", + "baseFile": "invalid-vlq-non-base64-char.js", + "sourceMapFile": "invalid-vlq-non-base64-char.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidVLQDueToMissingContinuationDigits", + "description": "Test a source map that has a mapping with an invalid VLQ that has a continuation bit but no continuing digits", + "baseFile": "invalid-vlq-missing-continuation.js", + "sourceMapFile": "invalid-vlq-missing-continuation.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingNotAString1", + "description": "Test a source map that has an invalid mapping that is not a string (number)", + "baseFile": "invalid-mapping-not-a-string-1.js", + "sourceMapFile": "invalid-mapping-not-a-string-1.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingNotAString2", + "description": "Test a source map that has an invalid mapping that is not a string (array)", + "baseFile": "invalid-mapping-not-a-string-2.js", + "sourceMapFile": "invalid-mapping-not-a-string-2.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentBadSeparator", + "description": "Test a source map that uses separator characters not recognized in the spec", + "baseFile": "invalid-mapping-bad-separator.js", + "sourceMapFile": "invalid-mapping-bad-separator.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithZeroFields", + "description": "Test a source map that has the wrong number (zero) of segments fields", + "baseFile": "invalid-mapping-segment-with-zero-fields.js", + "sourceMapFile": "invalid-mapping-segment-with-zero-fields.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithTwoFields", + "description": "Test a source map that has the wrong number (two) of segments fields", + "baseFile": "invalid-mapping-segment-with-two-fields.js", + "sourceMapFile": "invalid-mapping-segment-with-two-fields.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithThreeFields", + "description": "Test a source map that has the wrong number (three) of segments fields", + "baseFile": "invalid-mapping-segment-with-three-fields.js", + "sourceMapFile": "invalid-mapping-segment-with-three-fields.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithSourceIndexOutOfBounds", + "description": "Test a source map that has a source index field that is out of bounds of the sources field", + "baseFile": "invalid-mapping-segment-source-index-out-of-bounds.js", + "sourceMapFile": "invalid-mapping-segment-source-index-out-of-bounds.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNameIndexOutOfBounds", + "description": "Test a source map that has a name index field that is out of bounds of the names field", + "baseFile": "invalid-mapping-segment-name-index-out-of-bounds.js", + "sourceMapFile": "invalid-mapping-segment-name-index-out-of-bounds.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeColumn", + "description": "Test a source map that has an invalid negative non-relative column field", + "baseFile": "invalid-mapping-segment-negative-column.js", + "sourceMapFile": "invalid-mapping-segment-negative-column.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeSourceIndex", + "description": "Test a source map that has an invalid negative non-relative source index field", + "baseFile": "invalid-mapping-segment-negative-source-index.js", + "sourceMapFile": "invalid-mapping-segment-negative-source-index.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeOriginalLine", + "description": "Test a source map that has an invalid negative non-relative original line field", + "baseFile": "invalid-mapping-segment-negative-original-line.js", + "sourceMapFile": "invalid-mapping-segment-negative-original-line.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeOriginalColumn", + "description": "Test a source map that has an invalid negative non-relative original column field", + "baseFile": "invalid-mapping-segment-negative-original-column.js", + "sourceMapFile": "invalid-mapping-segment-negative-original-column.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeNameIndex", + "description": "Test a source map that has an invalid negative non-relative name index field", + "baseFile": "invalid-mapping-segment-negative-name-index.js", + "sourceMapFile": "invalid-mapping-segment-negative-name-index.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeRelativeColumn", + "description": "Test a source map that has an invalid negative relative column field", + "baseFile": "invalid-mapping-segment-negative-relative-column.js", + "sourceMapFile": "invalid-mapping-segment-negative-relative-column.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeRelativeSourceIndex", + "description": "Test a source map that has an invalid negative relative source index field", + "baseFile": "invalid-mapping-segment-negative-relative-source-index.js", + "sourceMapFile": "invalid-mapping-segment-negative-relative-source-index.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeRelativeOriginalLine", + "description": "Test a source map that has an invalid negative relative original line field", + "baseFile": "invalid-mapping-segment-negative-relative-original-line.js", + "sourceMapFile": "invalid-mapping-segment-negative-relative-original-line.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeRelativeOriginalColumn", + "description": "Test a source map that has an invalid negative relative original column field", + "baseFile": "invalid-mapping-segment-negative-relative-original-column.js", + "sourceMapFile": "invalid-mapping-segment-negative-relative-original-column.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNegativeRelativeNameIndex", + "description": "Test a source map that has an invalid negative relative name index field", + "baseFile": "invalid-mapping-segment-negative-relative-name-index.js", + "sourceMapFile": "invalid-mapping-segment-negative-relative-name-index.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithColumnExceeding32Bits", + "description": "Test a source map that has a column field that exceeds 32 bits", + "baseFile": "invalid-mapping-segment-column-too-large.js", + "sourceMapFile": "invalid-mapping-segment-column-too-large.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithSourceIndexExceeding32Bits", + "description": "Test a source map that has a source index field that exceeds 32 bits", + "baseFile": "invalid-mapping-segment-source-index-too-large.js", + "sourceMapFile": "invalid-mapping-segment-source-index-too-large.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithOriginalLineExceeding32Bits", + "description": "Test a source map that has a original line field that exceeds 32 bits", + "baseFile": "invalid-mapping-segment-original-line-too-large.js", + "sourceMapFile": "invalid-mapping-segment-original-line-too-large.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithOriginalColumnExceeding32Bits", + "description": "Test a source map that has an original column field that exceeds 32 bits", + "baseFile": "invalid-mapping-segment-original-column-too-large.js", + "sourceMapFile": "invalid-mapping-segment-original-column-too-large.js.map", + "sourceMapIsValid": false + }, + { + "name": "invalidMappingSegmentWithNameIndexExceeding32Bits", + "description": "Test a source map that has a name index field that exceeds 32 bits", + "baseFile": "invalid-mapping-segment-name-index-too-large.js", + "sourceMapFile": "invalid-mapping-segment-name-index-too-large.js.map", + "sourceMapIsValid": false + }, + { + "name": "validMappingFieldsWith32BitMaxValues", + "description": "Test a source map that has segment fields with max values representable in 32 bits", + "baseFile": "valid-mapping-boundary-values.js", + "sourceMapFile": "valid-mapping-boundary-values.js.map", + "sourceMapIsValid": true + }, + { + "name": "validMappingLargeVLQ", + "description": "Test a source map that has a segment field VLQ that is very long but within 32-bits", + "baseFile": "valid-mapping-large-vlq.js", + "sourceMapFile": "valid-mapping-large-vlq.js.map", + "sourceMapIsValid": true + }, + { + "name": "validMappingEmptyGroups", + "description": "Test a source map with a mapping that has many empty groups", + "baseFile": "valid-mapping-empty-groups.js", + "sourceMapFile": "valid-mapping-empty-groups.js.map", + "sourceMapIsValid": true + }, + { + "name": "indexMapWrongTypeSections", + "description": "Test an index map with a sections field with the wrong type", + "baseFile": "index-map-wrong-type-sections.js", + "sourceMapFile": "index-map-wrong-type-sections.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapWrongTypeOffset", + "description": "Test an index map with an offset field with the wrong type", + "baseFile": "index-map-wrong-type-offset.js", + "sourceMapFile": "index-map-wrong-type-offset.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapWrongTypeMap", + "description": "Test an index map with a map field with the wrong type", + "baseFile": "index-map-wrong-type-map.js", + "sourceMapFile": "index-map-wrong-type-map.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapInvalidBaseMappings", + "description": "Test that an index map cannot also have a regular mappings field", + "baseFile": "index-map-invalid-base-mappings.js", + "sourceMapFile": "index-map-invalid-base-mappings.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapInvalidOverlap", + "description": "Test that an invalid index map with multiple sections that overlap", + "baseFile": "index-map-invalid-overlap.js", + "sourceMapFile": "index-map-invalid-overlap.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapInvalidOrder", + "description": "Test that an invalid index map with multiple sections in the wrong order", + "baseFile": "index-map-invalid-order.js", + "sourceMapFile": "index-map-invalid-order.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapMissingMap", + "description": "Test that an index map that is missing a section map", + "baseFile": "index-map-missing-map.js", + "sourceMapFile": "index-map-missing-map.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapMissingOffset", + "description": "Test that an index map that is missing a section offset", + "baseFile": "index-map-missing-offset.js", + "sourceMapFile": "index-map-missing-offset.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapMissingOffsetLine", + "description": "Test that an index map that is missing a section offset's line field", + "baseFile": "index-map-missing-offset-line.js", + "sourceMapFile": "index-map-missing-offset-line.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapMissingOffsetColumn", + "description": "Test that an index map that is missing a section offset's column field", + "baseFile": "index-map-missing-offset-column.js", + "sourceMapFile": "index-map-missing-offset-column.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapOffsetLineWrongType", + "description": "Test that an index map that has an offset line field with the wrong type of value", + "baseFile": "index-map-offset-line-wrong-type.js", + "sourceMapFile": "index-map-offset-line-wrong-type.js.map", + "sourceMapIsValid": false + }, + { + "name": "indexMapOffsetColumnWrongType", + "description": "Test that an index map that has an offset column field with the wrong type of value", + "baseFile": "index-map-offset-column-wrong-type.js", + "sourceMapFile": "index-map-offset-column-wrong-type.js.map", + "sourceMapIsValid": false + }, + { + "name": "basicMapping", + "description": "Test a simple source map that has several valid mappings", + "baseFile": "basic-mapping.js", + "sourceMapFile": "basic-mapping.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 0, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 9, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 9, + "mappedName": "foo" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 15, + "originalLine": 1, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 22, + "originalLine": 1, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 24, + "originalLine": 2, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 25, + "originalLine": 3, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 34, + "originalSource": "basic-mapping-original.js", + "originalLine": 3, + "originalColumn": 9, + "mappedName": "bar" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 40, + "originalLine": 4, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 47, + "originalLine": 4, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 49, + "originalLine": 5, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 50, + "originalLine": 6, + "originalColumn": 0, + "mappedName": "foo" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 56, + "originalLine": 7, + "originalColumn": 0, + "mappedName": "bar" + } + ] + }, + { + "name": "basicMappingWithIndexMap", + "description": "Test a version of basic-mapping.js.map that is split into sections with an index map", + "baseFile": "basic-mapping-as-index-map.js", + "sourceMapFile": "basic-mapping-as-index-map.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 0, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 9, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 9, + "mappedName": "foo" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 15, + "originalLine": 1, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 22, + "originalLine": 1, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 24, + "originalLine": 2, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 25, + "originalLine": 3, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 34, + "originalSource": "basic-mapping-original.js", + "originalLine": 3, + "originalColumn": 9, + "mappedName": "bar" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 40, + "originalLine": 4, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 47, + "originalLine": 4, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 49, + "originalLine": 5, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 50, + "originalLine": 6, + "originalColumn": 0, + "mappedName": "foo" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 56, + "originalLine": 7, + "originalColumn": 0, + "mappedName": "bar" + } + ] + }, + { + "name": "indexMapWithTwoConcatenatedSources", + "description": "Test an index map that has two sub-maps for concatenated sources", + "baseFile": "index-map-two-concatenated-sources.js", + "sourceMapFile": "index-map-two-concatenated-sources.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 0, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 9, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 9, + "mappedName": "foo" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 15, + "originalLine": 1, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 22, + "originalLine": 1, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 24, + "originalLine": 2, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 25, + "originalLine": 3, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 34, + "originalSource": "basic-mapping-original.js", + "originalLine": 3, + "originalColumn": 9, + "mappedName": "bar" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 40, + "originalLine": 4, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 47, + "originalLine": 4, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 49, + "originalLine": 5, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 50, + "originalLine": 6, + "originalColumn": 0, + "mappedName": "foo" + }, + { + "actionType": "checkMapping", + "originalSource": "basic-mapping-original.js", + "generatedLine": 0, + "generatedColumn": 56, + "originalLine": 7, + "originalColumn": 0, + "mappedName": "bar" + }, + { + "actionType": "checkMapping", + "originalSource": "second-source-original.js", + "generatedLine": 0, + "generatedColumn": 62, + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "second-source-original.js", + "generatedLine": 0, + "generatedColumn": 71, + "originalLine": 0, + "originalColumn": 9, + "mappedName": "baz" + }, + { + "actionType": "checkMapping", + "originalSource": "second-source-original.js", + "generatedLine": 0, + "generatedColumn": 77, + "originalLine": 1, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "second-source-original.js", + "generatedLine": 0, + "generatedColumn": 83, + "originalLine": 1, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "second-source-original.js", + "generatedLine": 0, + "generatedColumn": 88, + "originalLine": 2, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "originalSource": "second-source-original.js", + "generatedLine": 0, + "generatedColumn": 89, + "originalLine": 3, + "originalColumn": 0, + "mappedName": "baz" + } + ] + }, + { + "name": "sourcesNullSourcesContentNonNull", + "description": "Test a source map that has a null source but has a sourcesContent", + "baseFile": "sources-null-sources-content-non-null.js", + "sourceMapFile": "sources-null-sources-content-non-null.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 0, + "originalSource": null, + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 9, + "originalSource": null, + "originalLine": 0, + "originalColumn": 9, + "mappedName": "foo" + } + ] + }, + { + "name": "sourcesNonNullSourcesContentNull", + "description": "Test a source map that has a non-null source but has a null sourcesContent", + "baseFile": "sources-non-null-sources-content-null.js", + "sourceMapFile": "sources-non-null-sources-content-null.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 0, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMapping", + "generatedLine": 0, + "generatedColumn": 9, + "originalSource": "basic-mapping-original.js", + "originalLine": 0, + "originalColumn": 9, + "mappedName": "foo" + } + ] + }, + { + "name": "transitiveMapping", + "description": "Test a simple two-stage transitive mapping from a minified JS to a TypeScript source", + "baseFile": "transitive-mapping.js", + "sourceMapFile": "transitive-mapping.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 0, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 1, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 9, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 1, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 13, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 1, + "originalColumn": 13, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 16, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 2, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 23, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 2, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 24, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 3, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 25, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 4, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 29, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping-original.js.map"], + "originalLine": 4, + "originalColumn": 4, + "mappedName": null + } + ] + }, + { + "name": "transitiveMappingWithThreeSteps", + "description": "Test a three-stage transitive mapping from an un-minified JS to minified JS to a TypeScript source", + "baseFile": "transitive-mapping-three-steps.js", + "sourceMapFile": "transitive-mapping-three-steps.js.map", + "sourceMapIsValid": true, + "testActions": [ + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 0, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 1, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 9, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 1, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 0, + "generatedColumn": 13, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 1, + "originalColumn": 13, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 1, + "generatedColumn": 4, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 2, + "originalColumn": 2, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 1, + "generatedColumn": 11, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 2, + "originalColumn": 9, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 2, + "generatedColumn": 0, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 3, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 4, + "generatedColumn": 0, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 4, + "originalColumn": 0, + "mappedName": null + }, + { + "actionType": "checkMappingTransitive", + "generatedLine": 4, + "generatedColumn": 4, + "originalSource": "typescript-original.ts", + "intermediateMaps": ["transitive-mapping.js.map", "transitive-mapping-original.js.map"], + "originalLine": 4, + "originalColumn": 4, + "mappedName": null + } + ] + } + ] +} diff --git a/webkit/0001-Add-harness-for-source-maps-spec-tests.patch b/webkit/0001-Add-harness-for-source-maps-spec-tests.patch new file mode 100644 index 0000000..050bf04 --- /dev/null +++ b/webkit/0001-Add-harness-for-source-maps-spec-tests.patch @@ -0,0 +1,1649 @@ +From d2ac7108de0b2a76e072ba8d7d4a9e733d3782ef Mon Sep 17 00:00:00 2001 +From: Asumu Takikawa +Date: Mon, 11 Mar 2024 13:41:31 -0700 +Subject: [PATCH] Add harness for source maps spec tests + +Need a short description (OOPS!). +Need the bug URL (OOPS!). + +Reviewed by NOBODY (OOPS!). + +Explanation of why this fixes the bug (OOPS!). + +* LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js: Added. +(foo): +(bar): +* LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js.map: Added. +* LayoutTests/inspector/model/resources/basic-mapping-original.js: Added. +(foo): +(bar): +* LayoutTests/inspector/model/resources/basic-mapping.js: Added. +(foo): +(bar): +* LayoutTests/inspector/model/resources/basic-mapping.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js: Added. +(foo): +(bar): +* LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js: Added. +(foo): +(bar): +* LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js: Added. +(foo): +(bar): +* LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js: Added. +* LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js.map: Added. +* LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js: Added. +* LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js.map: Added. +* LayoutTests/inspector/model/resources/names-missing.js: Added. +* LayoutTests/inspector/model/resources/names-missing.js.map: Added. +* LayoutTests/inspector/model/resources/names-not-a-list-1.js: Added. +* LayoutTests/inspector/model/resources/names-not-a-list-1.js.map: Added. +* LayoutTests/inspector/model/resources/names-not-a-list-2.js: Added. +* LayoutTests/inspector/model/resources/names-not-a-list-2.js.map: Added. +* LayoutTests/inspector/model/resources/source-map-spec-tests.json: Added. +* LayoutTests/inspector/model/resources/sources-missing.js: Added. +* LayoutTests/inspector/model/resources/sources-missing.js.map: Added. +* LayoutTests/inspector/model/resources/sources-not-a-list-1.js: Added. +* LayoutTests/inspector/model/resources/sources-not-a-list-1.js.map: Added. +* LayoutTests/inspector/model/resources/sources-not-a-list-2.js: Added. +* LayoutTests/inspector/model/resources/sources-not-a-list-2.js.map: Added. +* LayoutTests/inspector/model/resources/unrecognized-property.js: Added. +* LayoutTests/inspector/model/resources/unrecognized-property.js.map: Added. +* LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js: Added. +* LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js.map: Added. +* LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js: Added. +* LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js.map: Added. +* LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js: Added. +* LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js.map: Added. +* LayoutTests/inspector/model/resources/valid-mapping-null-sources.js: Added. +(foo): +(bar): +* LayoutTests/inspector/model/resources/valid-mapping-null-sources.js.map: Added. +* LayoutTests/inspector/model/resources/version-not-a-number.js: Added. +* LayoutTests/inspector/model/resources/version-not-a-number.js.map: Added. +* LayoutTests/inspector/model/resources/version-numeric-string.js: Added. +* LayoutTests/inspector/model/resources/version-numeric-string.js.map: Added. +* LayoutTests/inspector/model/resources/version-too-high.js: Added. +* LayoutTests/inspector/model/resources/version-too-high.js.map: Added. +* LayoutTests/inspector/model/resources/version-too-low.js: Added. +* LayoutTests/inspector/model/resources/version-too-low.js.map: Added. +* LayoutTests/inspector/model/resources/version-valid.js: Added. +* LayoutTests/inspector/model/resources/version-valid.js.map: Added. +* LayoutTests/inspector/model/source-map-spec-expected.txt: Added. +* LayoutTests/inspector/model/source-map-spec.html: Added. +--- + .../resources/basic-mapping-as-index-map.js | 2 + + .../basic-mapping-as-index-map.js.map | 23 + + .../model/resources/basic-mapping-original.js | 8 + + .../model/resources/basic-mapping.js | 2 + + .../model/resources/basic-mapping.js.map | 6 + + .../invalid-mapping-bad-separator.js | 2 + + .../invalid-mapping-bad-separator.js.map | 6 + + .../invalid-mapping-not-a-string-1.js | 1 + + .../invalid-mapping-not-a-string-1.js.map | 7 + + .../invalid-mapping-not-a-string-2.js | 1 + + .../invalid-mapping-not-a-string-2.js.map | 7 + + ...nvalid-mapping-segment-column-too-large.js | 1 + + ...id-mapping-segment-column-too-large.js.map | 7 + + ...apping-segment-name-index-out-of-bounds.js | 1 + + ...ng-segment-name-index-out-of-bounds.js.map | 7 + + ...id-mapping-segment-name-index-too-large.js | 1 + + ...apping-segment-name-index-too-large.js.map | 7 + + ...invalid-mapping-segment-negative-column.js | 1 + + ...lid-mapping-segment-negative-column.js.map | 7 + + ...lid-mapping-segment-negative-name-index.js | 1 + + ...mapping-segment-negative-name-index.js.map | 7 + + ...apping-segment-negative-original-column.js | 1 + + ...ng-segment-negative-original-column.js.map | 7 + + ...-mapping-segment-negative-original-line.js | 1 + + ...ping-segment-negative-original-line.js.map | 7 + + ...d-mapping-segment-negative-source-index.js | 1 + + ...pping-segment-negative-source-index.js.map | 7 + + ...pping-segment-original-column-too-large.js | 1 + + ...g-segment-original-column-too-large.js.map | 7 + + ...mapping-segment-original-line-too-large.js | 1 + + ...ing-segment-original-line-too-large.js.map | 7 + + ...ping-segment-source-index-out-of-bounds.js | 1 + + ...-segment-source-index-out-of-bounds.js.map | 7 + + ...-mapping-segment-source-index-too-large.js | 1 + + ...ping-segment-source-index-too-large.js.map | 7 + + ...valid-mapping-segment-with-three-fields.js | 2 + + ...d-mapping-segment-with-three-fields.js.map | 6 + + ...invalid-mapping-segment-with-two-fields.js | 2 + + ...lid-mapping-segment-with-two-fields.js.map | 6 + + ...nvalid-mapping-segment-with-zero-fields.js | 1 + + ...id-mapping-segment-with-zero-fields.js.map | 7 + + .../resources/invalid-vlq-non-base64-char.js | 1 + + .../invalid-vlq-non-base64-char.js.map | 6 + + .../model/resources/names-missing.js | 1 + + .../model/resources/names-missing.js.map | 5 + + .../model/resources/names-not-a-list-1.js | 1 + + .../model/resources/names-not-a-list-1.js.map | 6 + + .../model/resources/names-not-a-list-2.js | 1 + + .../model/resources/names-not-a-list-2.js.map | 6 + + .../resources/source-map-spec-tests.json | 503 ++++++++++++++++++ + .../model/resources/sources-missing.js | 1 + + .../model/resources/sources-missing.js.map | 5 + + .../model/resources/sources-not-a-list-1.js | 1 + + .../resources/sources-not-a-list-1.js.map | 6 + + .../model/resources/sources-not-a-list-2.js | 1 + + .../resources/sources-not-a-list-2.js.map | 6 + + .../model/resources/unrecognized-property.js | 1 + + .../resources/unrecognized-property.js.map | 8 + + .../valid-mapping-boundary-values.js | 1 + + .../valid-mapping-boundary-values.js.map | 7 + + .../resources/valid-mapping-empty-groups.js | 1 + + .../valid-mapping-empty-groups.js.map | 7 + + .../resources/valid-mapping-large-vlq.js | 1 + + .../resources/valid-mapping-large-vlq.js.map | 6 + + .../resources/valid-mapping-null-sources.js | 2 + + .../valid-mapping-null-sources.js.map | 6 + + .../model/resources/version-not-a-number.js | 1 + + .../resources/version-not-a-number.js.map | 6 + + .../model/resources/version-numeric-string.js | 1 + + .../resources/version-numeric-string.js.map | 6 + + .../model/resources/version-too-high.js | 1 + + .../model/resources/version-too-high.js.map | 6 + + .../model/resources/version-too-low.js | 1 + + .../model/resources/version-too-low.js.map | 6 + + .../model/resources/version-valid.js | 1 + + .../model/resources/version-valid.js.map | 6 + + .../model/source-map-spec-expected.txt | 22 + + .../inspector/model/source-map-spec.html | 83 +++ + 78 files changed, 915 insertions(+) + create mode 100644 LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js + create mode 100644 LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js.map + create mode 100644 LayoutTests/inspector/model/resources/basic-mapping-original.js + create mode 100644 LayoutTests/inspector/model/resources/basic-mapping.js + create mode 100644 LayoutTests/inspector/model/resources/basic-mapping.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js.map + create mode 100644 LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js + create mode 100644 LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js.map + create mode 100644 LayoutTests/inspector/model/resources/names-missing.js + create mode 100644 LayoutTests/inspector/model/resources/names-missing.js.map + create mode 100644 LayoutTests/inspector/model/resources/names-not-a-list-1.js + create mode 100644 LayoutTests/inspector/model/resources/names-not-a-list-1.js.map + create mode 100644 LayoutTests/inspector/model/resources/names-not-a-list-2.js + create mode 100644 LayoutTests/inspector/model/resources/names-not-a-list-2.js.map + create mode 100644 LayoutTests/inspector/model/resources/source-map-spec-tests.json + create mode 100644 LayoutTests/inspector/model/resources/sources-missing.js + create mode 100644 LayoutTests/inspector/model/resources/sources-missing.js.map + create mode 100644 LayoutTests/inspector/model/resources/sources-not-a-list-1.js + create mode 100644 LayoutTests/inspector/model/resources/sources-not-a-list-1.js.map + create mode 100644 LayoutTests/inspector/model/resources/sources-not-a-list-2.js + create mode 100644 LayoutTests/inspector/model/resources/sources-not-a-list-2.js.map + create mode 100644 LayoutTests/inspector/model/resources/unrecognized-property.js + create mode 100644 LayoutTests/inspector/model/resources/unrecognized-property.js.map + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js.map + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js.map + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js.map + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-null-sources.js + create mode 100644 LayoutTests/inspector/model/resources/valid-mapping-null-sources.js.map + create mode 100644 LayoutTests/inspector/model/resources/version-not-a-number.js + create mode 100644 LayoutTests/inspector/model/resources/version-not-a-number.js.map + create mode 100644 LayoutTests/inspector/model/resources/version-numeric-string.js + create mode 100644 LayoutTests/inspector/model/resources/version-numeric-string.js.map + create mode 100644 LayoutTests/inspector/model/resources/version-too-high.js + create mode 100644 LayoutTests/inspector/model/resources/version-too-high.js.map + create mode 100644 LayoutTests/inspector/model/resources/version-too-low.js + create mode 100644 LayoutTests/inspector/model/resources/version-too-low.js.map + create mode 100644 LayoutTests/inspector/model/resources/version-valid.js + create mode 100644 LayoutTests/inspector/model/resources/version-valid.js.map + create mode 100644 LayoutTests/inspector/model/source-map-spec-expected.txt + create mode 100644 LayoutTests/inspector/model/source-map-spec.html + +diff --git a/LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js b/LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js +new file mode 100644 +index 000000000000..b9fae380437d +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=basic-mapping-as-index-map.js.map +diff --git a/LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js.map b/LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js.map +new file mode 100644 +index 000000000000..12053a5698a6 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/basic-mapping-as-index-map.js.map +@@ -0,0 +1,23 @@ ++{ ++ "version": "3", ++ "sections": [ ++ { ++ "offset": { "line": 0, "column": 0 }, ++ "map": { ++ "version": "3", ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAAA,SAASA,MACP,OAAO,EACT,CACA" ++ } ++ }, ++ { ++ "offset": { "line": 0, "column": 34 }, ++ "map": { ++ "version": "3", ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAGSC,MACP,OAAO,EACT,CACAD,MACAC" ++ } ++ } ++ ] ++} +diff --git a/LayoutTests/inspector/model/resources/basic-mapping-original.js b/LayoutTests/inspector/model/resources/basic-mapping-original.js +new file mode 100644 +index 000000000000..301b186cb15e +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/basic-mapping-original.js +@@ -0,0 +1,8 @@ ++function foo() { ++ return 42; ++} ++function bar() { ++ return 24; ++} ++foo(); ++bar(); +diff --git a/LayoutTests/inspector/model/resources/basic-mapping.js b/LayoutTests/inspector/model/resources/basic-mapping.js +new file mode 100644 +index 000000000000..2e479a4175b8 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/basic-mapping.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=basic-mapping.js.map +diff --git a/LayoutTests/inspector/model/resources/basic-mapping.js.map b/LayoutTests/inspector/model/resources/basic-mapping.js.map +new file mode 100644 +index 000000000000..12dc9679a4b1 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/basic-mapping.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version":3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings":"AAAA,SAASA,MACP,OAAO,EACT,CACA,SAASC,MACP,OAAO,EACT,CACAD,MACAC" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js b/LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js +new file mode 100644 +index 000000000000..25338aca30ce +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=invalid-mapping-bad-separator.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js.map +new file mode 100644 +index 000000000000..5f4f5b92330a +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-bad-separator.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAAA.SAASA:MACP" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js +new file mode 100644 +index 000000000000..cb38e2fe9d7b +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-not-a-string-1.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js.map +new file mode 100644 +index 000000000000..5bf3e2a9d85b +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-1.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-not-a-string-1.js", ++ "sources": ["empty-original.js"], ++ "mappings": 5 ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js +new file mode 100644 +index 000000000000..3d84abd6c6b4 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-not-a-string-2.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js.map +new file mode 100644 +index 000000000000..4527e7f7641c +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-not-a-string-2.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-not-a-string-2.js", ++ "sources": ["empty-original.js"], ++ "mappings": [1, 2, 3, 4] ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js +new file mode 100644 +index 000000000000..55591f874b1b +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-column-too-large.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js.map +new file mode 100644 +index 000000000000..b4c059e0151b +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-column-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-column-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "ggggggE" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js +new file mode 100644 +index 000000000000..2a6b434eff58 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-name-index-out-of-bounds.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map +new file mode 100644 +index 000000000000..8dd2ea6c2da0 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-out-of-bounds.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": ["foo"], ++ "file": "invalid-mapping-segment-name-index-out-of-bounds.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAAC" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js +new file mode 100644 +index 000000000000..709e34dbd326 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-name-index-too-large.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js.map +new file mode 100644 +index 000000000000..c7bf5b98d120 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-name-index-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-name-index-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAAggggggE" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js +new file mode 100644 +index 000000000000..a202152d6fdf +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-column.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js.map +new file mode 100644 +index 000000000000..403878bfa47a +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-column.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-column.js", ++ "sources": ["empty-original.js"], ++ "mappings": "F" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js +new file mode 100644 +index 000000000000..3e3f63420467 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-name-index.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js.map +new file mode 100644 +index 000000000000..b94f63646e46 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-name-index.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-name-index.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAAF" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js +new file mode 100644 +index 000000000000..f21d5342b395 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-original-column.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js.map +new file mode 100644 +index 000000000000..011c639d3f91 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-column.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-original-column.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAF" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js +new file mode 100644 +index 000000000000..b37309601ce0 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-original-line.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js.map +new file mode 100644 +index 000000000000..e7ec993eebda +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-original-line.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-original-line.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAFA" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js +new file mode 100644 +index 000000000000..6e05849b6a03 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-negative-source-index.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js.map +new file mode 100644 +index 000000000000..596c2f298bbe +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-negative-source-index.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-negative-source-index.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AFAA" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js +new file mode 100644 +index 000000000000..0936ed7ea8fd +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-original-column-too-large.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js.map +new file mode 100644 +index 000000000000..ff2103fe24fe +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-column-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-original-column-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAAggggggE" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js +new file mode 100644 +index 000000000000..9b3aa5a361ae +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-original-line-too-large.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js.map +new file mode 100644 +index 000000000000..890f1c71fc5b +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-original-line-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-original-line-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AAggggggEA" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js +new file mode 100644 +index 000000000000..2e5fbca26825 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-source-index-out-of-bounds.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map +new file mode 100644 +index 000000000000..86dedb114fa9 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-out-of-bounds.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-source-index-out-of-bounds.js", ++ "sources": ["empty-original.js"], ++ "mappings": "ACAA" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js +new file mode 100644 +index 000000000000..3f4943e1272d +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-source-index-too-large.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js.map +new file mode 100644 +index 000000000000..e9f858c6e15d +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-source-index-too-large.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-source-index-too-large.js", ++ "sources": ["empty-original.js"], ++ "mappings": "AggggggEAA" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js +new file mode 100644 +index 000000000000..4b868fac9c5e +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=invalid-mapping-three-fields.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js.map +new file mode 100644 +index 000000000000..c2af1165ad8f +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-three-fields.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AAA" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js +new file mode 100644 +index 000000000000..96045a7a11dd +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=invalid-mapping-two-fields.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js.map +new file mode 100644 +index 000000000000..73cf00fa1c96 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-two-fields.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": ["foo","bar"], ++ "sources": ["basic-mapping-original.js"], ++ "mappings": "AA" ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js +new file mode 100644 +index 000000000000..9d5332a56ca5 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-mapping-segment-column-with-zero-fields.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js.map b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js.map +new file mode 100644 +index 000000000000..5a34d25b645e +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-mapping-segment-with-zero-fields.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "invalid-mapping-segment-with-zero-fields.js", ++ "sources": ["empty-original.js"], ++ "mappings": ",,,," ++} +diff --git a/LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js b/LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js +new file mode 100644 +index 000000000000..d1b20b41a29f +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=invalid-vlq-non-base64-char.js.map +diff --git a/LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js.map b/LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js.map +new file mode 100644 +index 000000000000..4fa1ac576885 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/invalid-vlq-non-base64-char.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "A$%?!" ++} +diff --git a/LayoutTests/inspector/model/resources/names-missing.js b/LayoutTests/inspector/model/resources/names-missing.js +new file mode 100644 +index 000000000000..58781fd88705 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/names-missing.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=names-missing.js.map +diff --git a/LayoutTests/inspector/model/resources/names-missing.js.map b/LayoutTests/inspector/model/resources/names-missing.js.map +new file mode 100644 +index 000000000000..7dc1b929e485 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/names-missing.js.map +@@ -0,0 +1,5 @@ ++{ ++ "version" : "3", ++ "sources": ["empty-original.js"], ++ "mappings": "" ++} +diff --git a/LayoutTests/inspector/model/resources/names-not-a-list-1.js b/LayoutTests/inspector/model/resources/names-not-a-list-1.js +new file mode 100644 +index 000000000000..dc65f1972b5a +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/names-not-a-list-1.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=names-not-a-list-1.js.map +diff --git a/LayoutTests/inspector/model/resources/names-not-a-list-1.js.map b/LayoutTests/inspector/model/resources/names-not-a-list-1.js.map +new file mode 100644 +index 000000000000..843f7cc2e6fd +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/names-not-a-list-1.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3", ++ "sources": ["source.js"], ++ "names": "not a list", ++ "mappings": "AAAAA" ++} +diff --git a/LayoutTests/inspector/model/resources/names-not-a-list-2.js b/LayoutTests/inspector/model/resources/names-not-a-list-2.js +new file mode 100644 +index 000000000000..d7251f78da84 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/names-not-a-list-2.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=names-not-a-list-2.js.map +diff --git a/LayoutTests/inspector/model/resources/names-not-a-list-2.js.map b/LayoutTests/inspector/model/resources/names-not-a-list-2.js.map +new file mode 100644 +index 000000000000..cd7a42a74c4f +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/names-not-a-list-2.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3", ++ "sources": ["source.js"], ++ "names": { "foo": 3 }, ++ "mappings": "AAAAA" ++} +diff --git a/LayoutTests/inspector/model/resources/source-map-spec-tests.json b/LayoutTests/inspector/model/resources/source-map-spec-tests.json +new file mode 100644 +index 000000000000..3091a3c93273 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/source-map-spec-tests.json +@@ -0,0 +1,503 @@ ++{ ++ "tests": [ ++ { ++ "name": "versionValid", ++ "description": "Test a simple source map with a valid version number", ++ "baseFile": "version-valid.js", ++ "sourceMapFile": "version-valid.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "versionNotANumber", ++ "description": "Test a source map with a version field that is not a number", ++ "baseFile": "version-not-a-number.js", ++ "sourceMapFile": "version-not-a-number.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionNumericString", ++ "description": "Test a source map with a version field that is a number as a string", ++ "baseFile": "version-numeric-string.js", ++ "sourceMapFile": "version-numeric-string.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionTooHigh", ++ "description": "Test a source map with an integer version field that is too high", ++ "baseFile": "version-too-high.js", ++ "sourceMapFile": "version-too-high.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "versionTooLow", ++ "description": "Test a source map with an integer version field that is too low", ++ "baseFile": "version-too-low.js", ++ "sourceMapFile": "version-too-low.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "sourcesMissing", ++ "description": "Test a source map that is missing a necessary sources field", ++ "baseFile": "sources-missing.js", ++ "sourceMapFile": "sources-missing.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "sourcesNotAList1", ++ "description": "Test a source map with a sources field that is not a valid list (string)", ++ "baseFile": "sources-not-a-list-1.js", ++ "sourceMapFile": "sources-not-a-list-1.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "sourcesNotAList2", ++ "description": "Test a source map with a sources field that is not a valid list (object)", ++ "baseFile": "sources-not-a-list-2.js", ++ "sourceMapFile": "sources-not-a-list-2.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "namesMissing", ++ "description": "Test a source map that is missing a necessary names field", ++ "baseFile": "names-missing.js", ++ "sourceMapFile": "names-missing.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "namesNotAList1", ++ "description": "Test a source map with a names field that is not a valid list (string)", ++ "baseFile": "names-not-a-list-1.js", ++ "sourceMapFile": "names-not-a-list-1.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "namesNotAList2", ++ "description": "Test a source map with a names field that is not a valid list (object)", ++ "baseFile": "names-not-a-list-2.js", ++ "sourceMapFile": "names-not-a-list-2.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "unrecognizedProperty", ++ "description": "Test a source map that has an extra field not explicitly encoded in the spec", ++ "baseFile": "unrecognized-property.js", ++ "sourceMapFile": "unrecognized-property.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "invalidVLQDueToNonBase64Character", ++ "description": "Test a source map that has a mapping with an invalid non-base64 character", ++ "baseFile": "invalid-vlq-non-base64-char.js", ++ "sourceMapFile": "invalid-vlq-non-base64-char.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingNotAString1", ++ "description": "Test a source map that has an invalid mapping that is not a string (number)", ++ "baseFile": "invalid-mapping-not-a-string-1.js", ++ "sourceMapFile": "invalid-mapping-not-a-string-1.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingNotAString2", ++ "description": "Test a source map that has an invalid mapping that is not a string (array)", ++ "baseFile": "invalid-mapping-not-a-string-2.js", ++ "sourceMapFile": "invalid-mapping-not-a-string-2.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentBadSeparator", ++ "description": "Test a source map that uses separator characters not recognized in the spec", ++ "baseFile": "invalid-mapping-bad-separator.js", ++ "sourceMapFile": "invalid-mapping-bad-separator.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithZeroFields", ++ "description": "Test a source map that has the wrong number (zero) of segments fields", ++ "baseFile": "invalid-mapping-segment-with-zero-fields.js", ++ "sourceMapFile": "invalid-mapping-segment-with-zero-fields.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithTwoFields", ++ "description": "Test a source map that has the wrong number (two) of segments fields", ++ "baseFile": "invalid-mapping-segment-with-two-fields.js", ++ "sourceMapFile": "invalid-mapping-segment-with-two-fields.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithThreeFields", ++ "description": "Test a source map that has the wrong number (three) of segments fields", ++ "baseFile": "invalid-mapping-segment-with-three-fields.js", ++ "sourceMapFile": "invalid-mapping-segment-with-three-fields.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithSourceIndexOutOfBounds", ++ "description": "Test a source map that has a source index field that is out of bounds of the sources field", ++ "baseFile": "invalid-mapping-segment-source-index-out-of-bounds.js", ++ "sourceMapFile": "invalid-mapping-segment-source-index-out-of-bounds.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNameIndexOutOfBounds", ++ "description": "Test a source map that has a name index field that is out of bounds of the names field", ++ "baseFile": "invalid-mapping-segment-name-index-out-of-bounds.js", ++ "sourceMapFile": "invalid-mapping-segment-name-index-out-of-bounds.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeColumn", ++ "description": "Test a source map that has an invalid negative non-relative column field", ++ "baseFile": "invalid-mapping-segment-negative-column.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-column.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeSourceIndex", ++ "description": "Test a source map that has an invalid negative non-relative source index field", ++ "baseFile": "invalid-mapping-segment-negative-source-index.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-source-index.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeOriginalLine", ++ "description": "Test a source map that has an invalid negative non-relative original line field", ++ "baseFile": "invalid-mapping-segment-negative-original-line.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-original-line.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeOriginalColumn", ++ "description": "Test a source map that has an invalid negative non-relative original column field", ++ "baseFile": "invalid-mapping-segment-negative-original-column.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-original-column.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNegativeNameIndex", ++ "description": "Test a source map that has an invalid negative non-relative name index field", ++ "baseFile": "invalid-mapping-segment-negative-name-index.js", ++ "sourceMapFile": "invalid-mapping-segment-negative-name-index.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithColumnExceeding32Bits", ++ "description": "Test a source map that has a column field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-column-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-column-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithSourceIndexExceeding32Bits", ++ "description": "Test a source map that has a source index field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-source-index-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-source-index-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithOriginalLineExceeding32Bits", ++ "description": "Test a source map that has a original line field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-original-line-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-original-line-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithOriginalColumnExceeding32Bits", ++ "description": "Test a source map that has an original column field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-original-column-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-original-column-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "invalidMappingSegmentWithNameIndexExceeding32Bits", ++ "description": "Test a source map that has a name index field that exceeds 32 bits", ++ "baseFile": "invalid-mapping-segment-name-index-too-large.js", ++ "sourceMapFile": "invalid-mapping-segment-name-index-too-large.js.map", ++ "sourceMapIsValid": false ++ }, ++ { ++ "name": "validMappingFieldsWith32BitMaxValues", ++ "description": "Test a source map that has segment fields with max values representable in 32 bits", ++ "baseFile": "valid-mapping-boundary-values.js", ++ "sourceMapFile": "valid-mapping-boundary-values.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "validMappingLargeVLQ", ++ "description": "Test a source map that has a segment field VLQ that is very long but within 32-bits", ++ "baseFile": "valid-mapping-large-vlq.js", ++ "sourceMapFile": "valid-mapping-large-vlq.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "validMappingEmptyGroups", ++ "description": "Test a source map with a mapping that has many empty groups", ++ "baseFile": "valid-mapping-empty-groups.js", ++ "sourceMapFile": "valid-mapping-empty-groups.js.map", ++ "sourceMapIsValid": true ++ }, ++ { ++ "name": "basicMapping", ++ "description": "Test a simple source map that has several valid mappings", ++ "baseFile": "basic-mapping.js", ++ "sourceMapFile": "basic-mapping.js.map", ++ "sourceMapIsValid": true, ++ "testActions": [ ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 0, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 9, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 9, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 15, ++ "originalLine": 1, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 22, ++ "originalLine": 1, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 24, ++ "originalLine": 2, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 25, ++ "originalLine": 3, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 34, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 3, ++ "originalColumn": 9, ++ "mappedName": "bar" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 40, ++ "originalLine": 4, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 47, ++ "originalLine": 4, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 49, ++ "originalLine": 5, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 50, ++ "originalLine": 6, ++ "originalColumn": 0, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 56, ++ "originalLine": 7, ++ "originalColumn": 0, ++ "mappedName": "bar" ++ } ++ ] ++ }, ++ { ++ "name": "basicMappingWithIndexMap", ++ "description": "Test a version of basic-mapping.js.map that is split into sections with an index map", ++ "baseFile": "basic-mapping-as-index-map.js", ++ "sourceMapFile": "basic-mapping-as-index-map.js.map", ++ "sourceMapIsValid": true, ++ "testActions": [ ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 0, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 9, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 0, ++ "originalColumn": 9, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 15, ++ "originalLine": 1, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 22, ++ "originalLine": 1, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 24, ++ "originalLine": 2, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 25, ++ "originalLine": 3, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 34, ++ "originalSource": "basic-mapping-original.js", ++ "originalLine": 3, ++ "originalColumn": 9, ++ "mappedName": "bar" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 40, ++ "originalLine": 4, ++ "originalColumn": 2, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 47, ++ "originalLine": 4, ++ "originalColumn": 9, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 49, ++ "originalLine": 5, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 50, ++ "originalLine": 6, ++ "originalColumn": 0, ++ "mappedName": "foo" ++ }, ++ { ++ "actionType": "checkMapping", ++ "originalSource": "basic-mapping-original.js", ++ "generatedLine": 0, ++ "generatedColumn": 56, ++ "originalLine": 7, ++ "originalColumn": 0, ++ "mappedName": "bar" ++ } ++ ] ++ }, ++ { ++ "name": "validMappingNullSources", ++ "description": "Test a source map that has null sources", ++ "baseFile": "valid-mapping-null-sources.js", ++ "sourceMapFile": "valid-mapping-null-sources.js.map", ++ "sourceMapIsValid": true, ++ "testActions": [ ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 0, ++ "originalSource": null, ++ "originalLine": 0, ++ "originalColumn": 0, ++ "mappedName": null ++ }, ++ { ++ "actionType": "checkMapping", ++ "generatedLine": 0, ++ "generatedColumn": 9, ++ "originalSource": null, ++ "originalLine": 0, ++ "originalColumn": 9, ++ "mappedName": "foo" ++ } ++ ] ++ } ++ ] ++} +diff --git a/LayoutTests/inspector/model/resources/sources-missing.js b/LayoutTests/inspector/model/resources/sources-missing.js +new file mode 100644 +index 000000000000..779b865e2769 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/sources-missing.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=sources-missing.js.map +diff --git a/LayoutTests/inspector/model/resources/sources-missing.js.map b/LayoutTests/inspector/model/resources/sources-missing.js.map +new file mode 100644 +index 000000000000..61122fcb3f25 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/sources-missing.js.map +@@ -0,0 +1,5 @@ ++{ ++ "version" : "3", ++ "names": ["foo"], ++ "mappings": "" ++} +diff --git a/LayoutTests/inspector/model/resources/sources-not-a-list-1.js b/LayoutTests/inspector/model/resources/sources-not-a-list-1.js +new file mode 100644 +index 000000000000..7e33b7e86725 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/sources-not-a-list-1.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=sources-not-a-list-1.js.map +diff --git a/LayoutTests/inspector/model/resources/sources-not-a-list-1.js.map b/LayoutTests/inspector/model/resources/sources-not-a-list-1.js.map +new file mode 100644 +index 000000000000..b2e24787bc16 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/sources-not-a-list-1.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3", ++ "sources": "not a list", ++ "names": ["foo"], ++ "mappings": "AAAAA" ++} +diff --git a/LayoutTests/inspector/model/resources/sources-not-a-list-2.js b/LayoutTests/inspector/model/resources/sources-not-a-list-2.js +new file mode 100644 +index 000000000000..4021f763fc88 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/sources-not-a-list-2.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=sources-not-a-list-2.js.map +diff --git a/LayoutTests/inspector/model/resources/sources-not-a-list-2.js.map b/LayoutTests/inspector/model/resources/sources-not-a-list-2.js.map +new file mode 100644 +index 000000000000..6a6a8635729c +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/sources-not-a-list-2.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3", ++ "sources": { "source.js": 3 }, ++ "names": ["foo"], ++ "mappings": "AAAAA" ++} +diff --git a/LayoutTests/inspector/model/resources/unrecognized-property.js b/LayoutTests/inspector/model/resources/unrecognized-property.js +new file mode 100644 +index 000000000000..19dfb0e2e6c7 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/unrecognized-property.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=unrecognized-property.js.map +diff --git a/LayoutTests/inspector/model/resources/unrecognized-property.js.map b/LayoutTests/inspector/model/resources/unrecognized-property.js.map +new file mode 100644 +index 000000000000..40bee558a4ff +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/unrecognized-property.js.map +@@ -0,0 +1,8 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "", ++ "foobar": 42, ++ "unusedProperty": [1, 2, 3, 4] ++} +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js b/LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js +new file mode 100644 +index 000000000000..3c49709e05ac +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=valid-mapping-boundary-values.js.map +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js.map b/LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js.map +new file mode 100644 +index 000000000000..4dd836e63d8f +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-boundary-values.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": ["foo"], ++ "file": "valid-mapping-boundary-values.js", ++ "sources": ["empty-original.js"], ++ "mappings": "+/////DA+/////D+/////DA" ++} +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js b/LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js +new file mode 100644 +index 000000000000..a2b767b619a0 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=valid-mapping-empty-groups.js.map +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js.map b/LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js.map +new file mode 100644 +index 000000000000..53be4ae4ae91 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-empty-groups.js.map +@@ -0,0 +1,7 @@ ++{ ++ "version": 3, ++ "names": [], ++ "file": "valid-mapping-empty-groups.js", ++ "sources": ["empty-original.js"], ++ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" ++} +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js b/LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js +new file mode 100644 +index 000000000000..b0cd8978132a +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=valid-mapping-large-vlq.js.map +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js.map b/LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js.map +new file mode 100644 +index 000000000000..76e18704c4b1 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-large-vlq.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version": 3, ++ "names": [], ++ "sources": ["valid-mapping-large-vlq.js"], ++ "mappings": "igggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggA" ++} +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-null-sources.js b/LayoutTests/inspector/model/resources/valid-mapping-null-sources.js +new file mode 100644 +index 000000000000..ee2acf0f5b2f +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-null-sources.js +@@ -0,0 +1,2 @@ ++function foo(){return 42}function bar(){return 24}foo();bar(); ++//# sourceMappingURL=valid-mapping-null-sources.js.map +diff --git a/LayoutTests/inspector/model/resources/valid-mapping-null-sources.js.map b/LayoutTests/inspector/model/resources/valid-mapping-null-sources.js.map +new file mode 100644 +index 000000000000..199cda936955 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/valid-mapping-null-sources.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version":3, ++ "names": ["foo"], ++ "sources": [null], ++ "mappings":"AAAA,SAASA" ++} +diff --git a/LayoutTests/inspector/model/resources/version-not-a-number.js b/LayoutTests/inspector/model/resources/version-not-a-number.js +new file mode 100644 +index 000000000000..ae2342e2ffe5 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-not-a-number.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-not-a-number.js.map +diff --git a/LayoutTests/inspector/model/resources/version-not-a-number.js.map b/LayoutTests/inspector/model/resources/version-not-a-number.js.map +new file mode 100644 +index 000000000000..a584d6e69511 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-not-a-number.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3foo", ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/LayoutTests/inspector/model/resources/version-numeric-string.js b/LayoutTests/inspector/model/resources/version-numeric-string.js +new file mode 100644 +index 000000000000..a55170885da6 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-numeric-string.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-numeric-string.js.map +diff --git a/LayoutTests/inspector/model/resources/version-numeric-string.js.map b/LayoutTests/inspector/model/resources/version-numeric-string.js.map +new file mode 100644 +index 000000000000..dbe52a7d0df6 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-numeric-string.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : "3", ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/LayoutTests/inspector/model/resources/version-too-high.js b/LayoutTests/inspector/model/resources/version-too-high.js +new file mode 100644 +index 000000000000..55f4e1a298fa +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-too-high.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-too-high.js.map +diff --git a/LayoutTests/inspector/model/resources/version-too-high.js.map b/LayoutTests/inspector/model/resources/version-too-high.js.map +new file mode 100644 +index 000000000000..ee23be32ff27 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-too-high.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 4, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/LayoutTests/inspector/model/resources/version-too-low.js b/LayoutTests/inspector/model/resources/version-too-low.js +new file mode 100644 +index 000000000000..d9642920b313 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-too-low.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-too-low.js.map +diff --git a/LayoutTests/inspector/model/resources/version-too-low.js.map b/LayoutTests/inspector/model/resources/version-too-low.js.map +new file mode 100644 +index 000000000000..64ca7a6e2e92 +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-too-low.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 2, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/LayoutTests/inspector/model/resources/version-valid.js b/LayoutTests/inspector/model/resources/version-valid.js +new file mode 100644 +index 000000000000..82d0bfa1eb2a +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-valid.js +@@ -0,0 +1 @@ ++//# sourceMappingURL=version-valid.js.map +diff --git a/LayoutTests/inspector/model/resources/version-valid.js.map b/LayoutTests/inspector/model/resources/version-valid.js.map +new file mode 100644 +index 000000000000..1a163052d8fc +--- /dev/null ++++ b/LayoutTests/inspector/model/resources/version-valid.js.map +@@ -0,0 +1,6 @@ ++{ ++ "version" : 3, ++ "sources": [], ++ "names": [], ++ "mappings": "" ++} +diff --git a/LayoutTests/inspector/model/source-map-spec-expected.txt b/LayoutTests/inspector/model/source-map-spec-expected.txt +new file mode 100644 +index 000000000000..c74ab5bcfb32 +--- /dev/null ++++ b/LayoutTests/inspector/model/source-map-spec-expected.txt +@@ -0,0 +1,22 @@ ++Ensure a source map loads for resources with sourceMappingURLs. ++ ++ ++== Running test suite: SourceMapSpec ++-- Running test case: SourceMapSpec ++PASS: Resource should have loaded 1 SourceMap. ++PASS: SourceMap should be a WI.SourceMap instance. ++PASS: Resource may or may not load a SourceMap. ++PASS: Resource may or may not load a SourceMap. ++PASS: Resource may or may not load a SourceMap. ++PASS: Resource may or may not load a SourceMap. ++PASS: Resource should have loaded 1 SourceMap. ++PASS: SourceMap should be a WI.SourceMap instance. ++PASS: Resource should have loaded 1 SourceMap. ++PASS: SourceMap should be a WI.SourceMap instance. ++PASS: expectEqual(0, 0) ++PASS: expectEqual(9, 9) ++PASS: expectEqual("basic-mapping-original.js", "basic-mapping-original.js") ++PASS: expectEqual(3, 3) ++PASS: expectEqual(9, 9) ++PASS: expectEqual("basic-mapping-original.js", "basic-mapping-original.js") ++ +diff --git a/LayoutTests/inspector/model/source-map-spec.html b/LayoutTests/inspector/model/source-map-spec.html +new file mode 100644 +index 000000000000..b30b1dd526fc +--- /dev/null ++++ b/LayoutTests/inspector/model/source-map-spec.html +@@ -0,0 +1,83 @@ ++ ++ ++ ++ ++ ++ ++ ++

Ensure a source map loads for resources with sourceMappingURLs.

++ ++ +-- +2.39.2 + diff --git a/webkit/source-map-spec.html b/webkit/source-map-spec.html new file mode 100644 index 0000000..b30b1dd --- /dev/null +++ b/webkit/source-map-spec.html @@ -0,0 +1,83 @@ + + + + + + + +

Ensure a source map loads for resources with sourceMappingURLs.

+ +