Commit 57df50e98cd for nodejs
commit 57df50e98cd515b363a56f07131f53d224f47b9b
Author: Node.js GitHub Bot <github-bot@iojs.org>
Date: Mon Oct 5 21:39:53 2026 -0400
test: update test426-fixtures to 9ea66b466fd37e8a4050033d23b3e1480973c3d
PR-URL: https://github.com/nodejs/node/pull/66493
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
diff --git a/test/fixtures/test426/decoding/scopes/README.md b/test/fixtures/test426/decoding/scopes/README.md
index 7b3271adb3a..d64194b2a2c 100644
--- a/test/fixtures/test426/decoding/scopes/README.md
+++ b/test/fixtures/test426/decoding/scopes/README.md
@@ -1,5 +1,8 @@
## Test cases
+These file were copied from https://github.com/tc39/source-map-tests/blob/main/decoding/scopes
+and modified to match changes in the source maps specification.
+
- **empty-scopes-field**: Empty original scopes field
- **nil-scopes**: Multiple null original scopes
- **close-start-end-position-scopes**: Scopes with very close start and end
diff --git a/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map
index d072e199df2..e1cf4a53f65 100644
--- a/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map
+++ b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map
@@ -6,5 +6,5 @@
],
"mappings": "",
"names": [],
- "scopes": "BAAA,BAAA,CAB,BAAA,CAB,BAAB,CAC,CBA"
-}
\ No newline at end of file
+ "scopes": ["BAAA,BAAA,CAB,BAAA,CAB,BAAB,CAC,CBA"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden
index 3b2f5e80a5f..b40ae02344c 100644
--- a/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden
+++ b/test/fixtures/test426/decoding/scopes/close-start-end-position-scopes.map.golden
@@ -6,68 +6,70 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 0
- },
- "name": null,
- "kind": null,
- "isStackFrame": false,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 0,
- "column": 1
- },
- "name": null,
- "kind": null,
- "isStackFrame": false,
- "variables": [],
- "children": []
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
},
- {
- "start": {
- "line": 0,
- "column": 1
- },
- "end": {
- "line": 0,
- "column": 2
- },
- "name": null,
- "kind": null,
- "isStackFrame": false,
- "variables": [],
- "children": []
+ "end": {
+ "line": 1,
+ "column": 0
},
- {
- "start": {
- "line": 0,
- "column": 3
+ "name": null,
+ "kind": null,
+ "isStackFrame": false,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 0,
+ "column": 1
+ },
+ "name": null,
+ "kind": null,
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
},
- "end": {
- "line": 0,
- "column": 5
+ {
+ "start": {
+ "line": 0,
+ "column": 1
+ },
+ "end": {
+ "line": 0,
+ "column": 2
+ },
+ "name": null,
+ "kind": null,
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
},
- "name": null,
- "kind": null,
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
- ]
- }
+ {
+ "start": {
+ "line": 0,
+ "column": 3
+ },
+ "end": {
+ "line": 0,
+ "column": 5
+ },
+ "name": null,
+ "kind": null,
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
+ }
+ ]
}
],
"ranges": []
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/empty-scopes-field.map b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map
index 6f5baa6a0bf..79effe954dc 100644
--- a/test/fixtures/test426/decoding/scopes/empty-scopes-field.map
+++ b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map
@@ -4,5 +4,5 @@
"sources": [],
"mappings": "",
"names": [],
- "scopes": ""
-}
\ No newline at end of file
+ "scopes": []
+}
diff --git a/test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden
index 51eccb2cf95..6a592c459c1 100644
--- a/test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden
+++ b/test/fixtures/test426/decoding/scopes/empty-scopes-field.map.golden
@@ -3,4 +3,4 @@
"mappings": [],
"sources": [],
"ranges": []
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/hidden-ranges.map b/test/fixtures/test426/decoding/scopes/hidden-ranges.map
index 779a24269ff..dc53e39b326 100644
--- a/test/fixtures/test426/decoding/scopes/hidden-ranges.map
+++ b/test/fixtures/test426/decoding/scopes/hidden-ranges.map
@@ -9,5 +9,6 @@
"global",
"block"
],
- "scopes": "BCAAA,BCBAC,CEA,CFA,ECAA,EPBAC,FEA,FFA"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,BCBAC,CEA,CFA"],
+ "ranges": ["ECAAA,EPBAAC,FEA,FFA"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/hidden-ranges.map.golden b/test/fixtures/test426/decoding/scopes/hidden-ranges.map.golden
index 6564cca5ea4..216df22c47c 100644
--- a/test/fixtures/test426/decoding/scopes/hidden-ranges.map.golden
+++ b/test/fixtures/test426/decoding/scopes/hidden-ranges.map.golden
@@ -6,37 +6,39 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 0
- },
- "name": null,
- "kind": "block",
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
- ]
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ },
+ "name": null,
+ "kind": "block",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
+ }
+ ]
}
],
"ranges": [
@@ -49,7 +51,10 @@
"line": 10,
"column": 0
},
- "definitionIndex": 0,
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [],
@@ -63,7 +68,10 @@
"line": 5,
"column": 0
},
- "definitionIndex": 1,
+ "definition": {
+ "source": 0,
+ "scope": 1
+ },
"stackFrameType": "hidden",
"callSite": null,
"bindings": [],
@@ -72,4 +80,4 @@
]
}
]
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-in-one-file.map b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-in-one-file.map
new file mode 100644
index 00000000000..756f86b86e4
--- /dev/null
+++ b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-in-one-file.map
@@ -0,0 +1,16 @@
+{
+ "version": 3,
+ "file": "multiple-root-original-scopes-in-one-file.js",
+ "sources": [
+ "original_0.js"
+ ],
+ "mappings": "",
+ "names": [
+ "global",
+ "henry",
+ "synth",
+ "synth=",
+ "value"
+ ],
+ "scopes": ["BDAACA,CKA,BCBAA,CtSA,BCkDKA,CAe,BHAACA,CAA,BHAACA,DI,CAA"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-in-one-file.map.golden b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-in-one-file.map.golden
new file mode 100644
index 00000000000..d9d08b30f5a
--- /dev/null
+++ b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-in-one-file.map.golden
@@ -0,0 +1,89 @@
+{
+ "file": "multiple-root-original-scopes-in-one-file.js",
+ "mappings": [],
+ "sources": [
+ {
+ "url": "original_0.js",
+ "content": null,
+ "ignored": false,
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": "henry",
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ },
+ {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 600,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ },
+ {
+ "start": {
+ "line": 700,
+ "column": 10
+ },
+ "end": {
+ "line": 700,
+ "column": 40
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ },
+ {
+ "start": {
+ "line": 700,
+ "column": 40
+ },
+ "end": {
+ "line": 700,
+ "column": 40
+ },
+ "name": "synth",
+ "kind": "global",
+ "isStackFrame": true,
+ "variables": [],
+ "children": []
+ },
+ {
+ "start": {
+ "line": 700,
+ "column": 40
+ },
+ "end": {
+ "line": 700,
+ "column": 40
+ },
+ "name": "synth=",
+ "kind": "global",
+ "isStackFrame": true,
+ "variables": ["value"],
+ "children": []
+ }
+ ]
+ }
+ ],
+ "ranges": []
+}
diff --git a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map
index 3eaa7daa1c1..6c7d6e8fb71 100644
--- a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map
+++ b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map
@@ -10,5 +10,5 @@
"names": [
"global"
],
- "scopes": "BCAAA,CKA,A,BCAAA,CKA"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,CKA", null, "BCAAA,CKA"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden
index 2e69392b210..c90374b8ee5 100644
--- a/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden
+++ b/test/fixtures/test426/decoding/scopes/multiple-root-original-scopes-with-nil.map.golden
@@ -6,48 +6,52 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
},
{
"url": "original_1.js",
"content": null,
"ignored": false,
- "scope": null
+ "rootScopes": []
},
{
"url": "original_2.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
}
],
"ranges": []
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/nested-ranges.map b/test/fixtures/test426/decoding/scopes/nested-ranges.map
index 2ab612337ed..89aeee7e094 100644
--- a/test/fixtures/test426/decoding/scopes/nested-ranges.map
+++ b/test/fixtures/test426/decoding/scopes/nested-ranges.map
@@ -10,5 +10,6 @@
"foo",
"function"
],
- "scopes": "BCAAA,BHBACE,CEA,CFA,ECAA,EGCC,FC,FG"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,BHBACE,CEA,CFA"],
+ "ranges": ["ECAAA,EGCAC,FC,FG"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/nested-ranges.map.golden b/test/fixtures/test426/decoding/scopes/nested-ranges.map.golden
index 4d4138f113d..25fa078640f 100644
--- a/test/fixtures/test426/decoding/scopes/nested-ranges.map.golden
+++ b/test/fixtures/test426/decoding/scopes/nested-ranges.map.golden
@@ -6,37 +6,39 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 0
- },
- "name": "foo",
- "kind": "function",
- "isStackFrame": true,
- "variables": [],
- "children": []
- }
- ]
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ },
+ "name": "foo",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [],
+ "children": []
+ }
+ ]
+ }
+ ]
}
],
"ranges": [
@@ -49,7 +51,10 @@
"line": 0,
"column": 10
},
- "definitionIndex": 0,
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [],
@@ -63,7 +68,10 @@
"line": 0,
"column": 4
},
- "definitionIndex": 1,
+ "definition": {
+ "source": 0,
+ "scope": 1
+ },
"stackFrameType": "original",
"callSite": null,
"bindings": [],
@@ -72,4 +80,4 @@
]
}
]
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/nested-scopes.map b/test/fixtures/test426/decoding/scopes/nested-scopes.map
index 348668b216b..dd7291b25c5 100644
--- a/test/fixtures/test426/decoding/scopes/nested-scopes.map
+++ b/test/fixtures/test426/decoding/scopes/nested-scopes.map
@@ -10,5 +10,5 @@
"innerOriginalFunction",
"block"
],
- "scopes": "BAAA,BFKAA,BFFCC,BCFEE,CFE,CBC,CBA,CBA"
-}
\ No newline at end of file
+ "scopes": ["BAAA,BFKAA,BFFCC,BCFEE,CFE,CBC,CBA,CBA"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/nested-scopes.map.golden b/test/fixtures/test426/decoding/scopes/nested-scopes.map.golden
index d2fc9d2d310..8cc5690bff9 100644
--- a/test/fixtures/test426/decoding/scopes/nested-scopes.map.golden
+++ b/test/fixtures/test426/decoding/scopes/nested-scopes.map.golden
@@ -6,70 +6,72 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 28,
- "column": 0
- },
- "name": null,
- "kind": null,
- "isStackFrame": false,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 27,
- "column": 0
- },
- "name": "originalFunctionFoo",
- "kind": null,
- "isStackFrame": true,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 15,
- "column": 2
- },
- "end": {
- "line": 26,
- "column": 2
- },
- "name": "innerOriginalFunction",
- "kind": null,
- "isStackFrame": true,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 20,
- "column": 4
- },
- "end": {
- "line": 25,
- "column": 4
- },
- "name": null,
- "kind": "block",
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
- ]
- }
- ]
- }
- ]
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 28,
+ "column": 0
+ },
+ "name": null,
+ "kind": null,
+ "isStackFrame": false,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 27,
+ "column": 0
+ },
+ "name": "originalFunctionFoo",
+ "kind": null,
+ "isStackFrame": true,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 26,
+ "column": 2
+ },
+ "name": "innerOriginalFunction",
+ "kind": null,
+ "isStackFrame": true,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 20,
+ "column": 4
+ },
+ "end": {
+ "line": 25,
+ "column": 4
+ },
+ "name": null,
+ "kind": "block",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
],
"ranges": []
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/nil-scopes.map b/test/fixtures/test426/decoding/scopes/nil-scopes.map
index 88b20314e3b..6518626ee1b 100644
--- a/test/fixtures/test426/decoding/scopes/nil-scopes.map
+++ b/test/fixtures/test426/decoding/scopes/nil-scopes.map
@@ -9,5 +9,5 @@
],
"mappings": "",
"names": [],
- "scopes": "A,A,A,A"
-}
\ No newline at end of file
+ "scopes": [null, null, null, null]
+}
diff --git a/test/fixtures/test426/decoding/scopes/nil-scopes.map.golden b/test/fixtures/test426/decoding/scopes/nil-scopes.map.golden
index 93e7854420f..65f3cbf8801 100644
--- a/test/fixtures/test426/decoding/scopes/nil-scopes.map.golden
+++ b/test/fixtures/test426/decoding/scopes/nil-scopes.map.golden
@@ -6,26 +6,26 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": null
+ "rootScopes": []
},
{
"url": "original_1.js",
"content": null,
"ignored": false,
- "scope": null
+ "rootScopes": []
},
{
"url": "original_2.js",
"content": null,
"ignored": false,
- "scope": null
+ "rootScopes": []
},
{
"url": "original_3.js",
"content": null,
"ignored": false,
- "scope": null
+ "rootScopes": []
}
],
"ranges": []
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/range-call-site.map b/test/fixtures/test426/decoding/scopes/range-call-site.map
index 61e5a4c5a5d..2f47cb66895 100644
--- a/test/fixtures/test426/decoding/scopes/range-call-site.map
+++ b/test/fixtures/test426/decoding/scopes/range-call-site.map
@@ -10,5 +10,6 @@
"inlineMe",
"function"
],
- "scopes": "BCAAA,BHBACE,CEA,CFA,ECAA,EDBAC,IAGC,FK,FJA"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,BHBACE,CEA,CFA"],
+ "ranges": ["ECAAA,EDBAAC,IAGC,FK,FJA"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/range-call-site.map.golden b/test/fixtures/test426/decoding/scopes/range-call-site.map.golden
index b3ee2302946..32d4d4264ba 100644
--- a/test/fixtures/test426/decoding/scopes/range-call-site.map.golden
+++ b/test/fixtures/test426/decoding/scopes/range-call-site.map.golden
@@ -6,37 +6,39 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 0
- },
- "name": "inlineMe",
- "kind": "function",
- "isStackFrame": true,
- "variables": [],
- "children": []
- }
- ]
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ },
+ "name": "inlineMe",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [],
+ "children": []
+ }
+ ]
+ }
+ ]
}
],
"ranges": [
@@ -49,7 +51,10 @@
"line": 10,
"column": 0
},
- "definitionIndex": 0,
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [],
@@ -63,7 +68,10 @@
"line": 1,
"column": 10
},
- "definitionIndex": 1,
+ "definition": {
+ "source": 0,
+ "scope": 1
+ },
"stackFrameType": "none",
"callSite": {
"sourceIndex": 0,
@@ -76,4 +84,4 @@
]
}
]
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/range-values.map b/test/fixtures/test426/decoding/scopes/range-values.map
index c397423a243..4cd64546aad 100644
--- a/test/fixtures/test426/decoding/scopes/range-values.map
+++ b/test/fixtures/test426/decoding/scopes/range-values.map
@@ -16,5 +16,6 @@
"z_val",
"a_val"
],
- "scopes": "BCAAA,DCCC,BCBAI,DE,CEA,CFA,ECAA,GHAI,ECCC,GJ,FC,FG"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,DCCC,BCBAI,DE,CEA,CFA"],
+ "ranges": ["ECAAA,GHAI,ECCAC,GJ,FC,FG"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/range-values.map.golden b/test/fixtures/test426/decoding/scopes/range-values.map.golden
index a7cdec5139d..eaeecd57c7b 100644
--- a/test/fixtures/test426/decoding/scopes/range-values.map.golden
+++ b/test/fixtures/test426/decoding/scopes/range-values.map.golden
@@ -6,43 +6,45 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [
- "x",
- "y",
- "z"
- ],
- "children": [
- {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 5,
- "column": 0
- },
- "name": null,
- "kind": "block",
- "isStackFrame": false,
- "variables": [
- "a"
- ],
- "children": []
- }
- ]
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [
+ "x",
+ "y",
+ "z"
+ ],
+ "children": [
+ {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ },
+ "name": null,
+ "kind": "block",
+ "isStackFrame": false,
+ "variables": [
+ "a"
+ ],
+ "children": []
+ }
+ ]
+ }
+ ]
}
],
"ranges": [
@@ -55,7 +57,10 @@
"line": 0,
"column": 10
},
- "definitionIndex": 0,
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [
@@ -97,7 +102,10 @@
"line": 0,
"column": 4
},
- "definitionIndex": 1,
+ "definition": {
+ "source": 0,
+ "scope": 1
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [
@@ -116,4 +124,4 @@
]
}
]
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/scope-variables.map b/test/fixtures/test426/decoding/scopes/scope-variables.map
index 921c929abc4..afe050d2e22 100644
--- a/test/fixtures/test426/decoding/scopes/scope-variables.map
+++ b/test/fixtures/test426/decoding/scopes/scope-variables.map
@@ -19,5 +19,7 @@
"blockScopedVariable1",
"blockScopedVariable2"
],
- "scopes": "BCAAA,DCC,BHKFGI,DGCC,CJB,BHGFKA,DF,BCBIK,DKC,CDF,CBB,CBA"
-}
\ No newline at end of file
+ "scopes": [
+ "BCAAA,DCC,BHKFGI,DGCC,CJB,BHGFKA,DF,BCBIK,DKC,CDF,CBB,CBA"
+ ]
+}
diff --git a/test/fixtures/test426/decoding/scopes/scope-variables.map.golden b/test/fixtures/test426/decoding/scopes/scope-variables.map.golden
index 8af29866adc..cfc9eff66be 100644
--- a/test/fixtures/test426/decoding/scopes/scope-variables.map.golden
+++ b/test/fixtures/test426/decoding/scopes/scope-variables.map.golden
@@ -6,81 +6,83 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 31,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [
- "GLOBAL_CONSTANT1",
- "GLOBAL_CONSTANT2"
- ],
- "children": [
- {
- "start": {
- "line": 10,
- "column": 5
- },
- "end": {
- "line": 19,
- "column": 1
- },
- "name": "toplevelFunction1",
- "kind": "function",
- "isStackFrame": true,
- "variables": [
- "functionScopedVariable1",
- "functionScopedVariable2",
- "functionScopedVariable3"
- ],
- "children": []
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
},
- {
- "start": {
- "line": 25,
- "column": 5
- },
- "end": {
- "line": 30,
- "column": 1
+ "end": {
+ "line": 31,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [
+ "GLOBAL_CONSTANT1",
+ "GLOBAL_CONSTANT2"
+ ],
+ "children": [
+ {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 19,
+ "column": 1
+ },
+ "name": "toplevelFunction1",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [
+ "functionScopedVariable1",
+ "functionScopedVariable2",
+ "functionScopedVariable3"
+ ],
+ "children": []
},
- "name": "toplevelFunction2",
- "kind": "function",
- "isStackFrame": true,
- "variables": [
- "functionScopedVariable1"
- ],
- "children": [
- {
- "start": {
- "line": 26,
- "column": 8
- },
- "end": {
- "line": 29,
- "column": 5
- },
- "name": null,
- "kind": "block",
- "isStackFrame": false,
- "variables": [
- "blockScopedVariable1",
- "blockScopedVariable2"
- ],
- "children": []
- }
- ]
- }
- ]
- }
+ {
+ "start": {
+ "line": 25,
+ "column": 5
+ },
+ "end": {
+ "line": 30,
+ "column": 1
+ },
+ "name": "toplevelFunction2",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [
+ "functionScopedVariable1"
+ ],
+ "children": [
+ {
+ "start": {
+ "line": 26,
+ "column": 8
+ },
+ "end": {
+ "line": 29,
+ "column": 5
+ },
+ "name": null,
+ "kind": "block",
+ "isStackFrame": false,
+ "variables": [
+ "blockScopedVariable1",
+ "blockScopedVariable2"
+ ],
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
],
"ranges": []
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/scopes.d.ts b/test/fixtures/test426/decoding/scopes/scopes.d.ts
index 770fc8d7d8f..abd78ad9e14 100644
--- a/test/fixtures/test426/decoding/scopes/scopes.d.ts
+++ b/test/fixtures/test426/decoding/scopes/scopes.d.ts
@@ -6,7 +6,7 @@ interface SourceMapRecord {
}
interface SourceRecord {
- scope: OriginalScopeRecord|null;
+ rootScopes: OriginalScopeRecord[];
}
/**
@@ -28,17 +28,24 @@ interface OriginalScopeRecord {
interface GeneratedRangeRecord {
start: PositionRecord;
end: PositionRecord;
- /**
- * An index into a flattened list of {@link OriginalScopeRecord}. The flattened list is obtained by iterating
- * {@link SourceMapRecord.sources} from `0` to `SourceMapRecord.sources.length` and traverse each {@link SourceRecord.scope} in [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR).
- */
- definitionIndex: number|null;
+ definition: DefinitionRecord|null;
stackFrameType: 'none'|'original'|'hidden';
bindings: BindingRecord[][];
callSite: OriginalPositionRecord|null;
children: GeneratedRangeRecord[];
}
+interface DefinitionRecord {
+ /** An index into {@link SourceMapRecord.sources}. */
+ source: number;
+ /**
+ * An index into a flattened list of {@link OriginalScopeRecord} in the {@link SourceRecord} at `source`.
+ * The flattened list is obtained by iterating {@link SourceRecord.rootScopes} from `0` to `SourceRecord.rootScopes.length`
+ * and traversing each {@link OriginalScopeRecord} in [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR).
+ */
+ scope: number;
+}
+
/**
* Corresponds to a [Binding Record](https://tc39.es/ecma426/branch/proposal-scopes/#sec-binding-record-type)
*/
diff --git a/test/fixtures/test426/decoding/scopes/sibling-ranges-2.map b/test/fixtures/test426/decoding/scopes/sibling-ranges-2.map
new file mode 100644
index 00000000000..5b6da49119b
--- /dev/null
+++ b/test/fixtures/test426/decoding/scopes/sibling-ranges-2.map
@@ -0,0 +1,14 @@
+{
+ "version": 3,
+ "file": "sibling-ranges.js",
+ "sources": [
+ "original_0.js",
+ "original_1.js"
+ ],
+ "mappings": "",
+ "names": [
+ "global"
+ ],
+ "scopes": ["BCAAA,CKA","BCKAA,CKA"],
+ "ranges": ["ECAAA,FK","EDKACA,FK","EBUAA,FK"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/sibling-ranges-2.map.golden b/test/fixtures/test426/decoding/scopes/sibling-ranges-2.map.golden
new file mode 100644
index 00000000000..6a4bc25bc93
--- /dev/null
+++ b/test/fixtures/test426/decoding/scopes/sibling-ranges-2.map.golden
@@ -0,0 +1,103 @@
+{
+ "file": "sibling-ranges.js",
+ "mappings": [],
+ "sources": [
+ {
+ "url": "original_0.js",
+ "content": null,
+ "ignored": false,
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
+ },
+ {
+ "url": "original_1.js",
+ "content": null,
+ "ignored": false,
+ "rootScopes": [
+ {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
+ }
+ ],
+ "ranges": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 0,
+ "column": 10
+ },
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
+ "stackFrameType": "none",
+ "callSite": null,
+ "bindings": [],
+ "children": []
+ },
+ {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ },
+ "definition": {
+ "source": 1,
+ "scope": 0
+ },
+ "stackFrameType": "none",
+ "callSite": null,
+ "bindings": [],
+ "children": []
+ },
+ {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 10
+ },
+ "definition": null,
+ "stackFrameType": "none",
+ "callSite": null,
+ "bindings": [],
+ "children": []
+ }
+ ]
+}
diff --git a/test/fixtures/test426/decoding/scopes/sibling-ranges.map b/test/fixtures/test426/decoding/scopes/sibling-ranges.map
index ea90f645612..ab2b6fd25e5 100644
--- a/test/fixtures/test426/decoding/scopes/sibling-ranges.map
+++ b/test/fixtures/test426/decoding/scopes/sibling-ranges.map
@@ -9,5 +9,6 @@
"names": [
"global"
],
- "scopes": "BCAAA,CKA,BCKAA,CKA,ECAA,FK,EDKAC,FK,EBKA,FK"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,CKA","BCKAA,CKA"],
+ "ranges": ["ECAAA,FK,EDKACA,FK,EBKAA,FK"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/sibling-ranges.map.golden b/test/fixtures/test426/decoding/scopes/sibling-ranges.map.golden
index dc1975d40d0..6a4bc25bc93 100644
--- a/test/fixtures/test426/decoding/scopes/sibling-ranges.map.golden
+++ b/test/fixtures/test426/decoding/scopes/sibling-ranges.map.golden
@@ -6,41 +6,45 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
},
{
"url": "original_1.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 10,
- "column": 0
- },
- "end": {
- "line": 20,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
}
],
"ranges": [
@@ -53,7 +57,10 @@
"line": 0,
"column": 10
},
- "definitionIndex": 0,
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [],
@@ -68,7 +75,10 @@
"line": 10,
"column": 10
},
- "definitionIndex": 1,
+ "definition": {
+ "source": 1,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [],
@@ -83,11 +93,11 @@
"line": 20,
"column": 10
},
- "definitionIndex": null,
+ "definition": null,
"stackFrameType": "none",
"callSite": null,
"bindings": [],
"children": []
}
]
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/sibling-scopes.map b/test/fixtures/test426/decoding/scopes/sibling-scopes.map
index 630a8c094a4..add88f43c35 100644
--- a/test/fixtures/test426/decoding/scopes/sibling-scopes.map
+++ b/test/fixtures/test426/decoding/scopes/sibling-scopes.map
@@ -12,5 +12,5 @@
"toplevelFunction3",
"toplevelFunction4"
],
- "scopes": "BAAA,BHKFAC,CIB,BHCFEA,CIB,BHCFCA,CIB,BHCFCA,CIB,CCA"
-}
\ No newline at end of file
+ "scopes": ["BAAA,BHKFAC,CIB,BHCFEA,CIB,BHCFCA,CIB,BHCFCA,CIB,CCA"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden b/test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden
index 54f49fa7ca9..8fa678ba561 100644
--- a/test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden
+++ b/test/fixtures/test426/decoding/scopes/sibling-scopes.map.golden
@@ -6,83 +6,85 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 50,
- "column": 0
- },
- "name": null,
- "kind": null,
- "isStackFrame": false,
- "variables": [],
- "children": [
- {
- "start": {
- "line": 10,
- "column": 5
- },
- "end": {
- "line": 18,
- "column": 1
- },
- "name": "toplevelFunction1",
- "kind": "function",
- "isStackFrame": true,
- "variables": [],
- "children": []
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
},
- {
- "start": {
- "line": 20,
- "column": 5
- },
- "end": {
- "line": 28,
- "column": 1
- },
- "name": "toplevelFunction2",
- "kind": "function",
- "isStackFrame": true,
- "variables": [],
- "children": []
+ "end": {
+ "line": 50,
+ "column": 0
},
- {
- "start": {
- "line": 30,
- "column": 5
- },
- "end": {
- "line": 38,
- "column": 1
+ "name": null,
+ "kind": null,
+ "isStackFrame": false,
+ "variables": [],
+ "children": [
+ {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 18,
+ "column": 1
+ },
+ "name": "toplevelFunction1",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [],
+ "children": []
},
- "name": "toplevelFunction3",
- "kind": "function",
- "isStackFrame": true,
- "variables": [],
- "children": []
- },
- {
- "start": {
- "line": 40,
- "column": 5
+ {
+ "start": {
+ "line": 20,
+ "column": 5
+ },
+ "end": {
+ "line": 28,
+ "column": 1
+ },
+ "name": "toplevelFunction2",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [],
+ "children": []
},
- "end": {
- "line": 48,
- "column": 1
+ {
+ "start": {
+ "line": 30,
+ "column": 5
+ },
+ "end": {
+ "line": 38,
+ "column": 1
+ },
+ "name": "toplevelFunction3",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [],
+ "children": []
},
- "name": "toplevelFunction4",
- "kind": "function",
- "isStackFrame": true,
- "variables": [],
- "children": []
- }
- ]
- }
+ {
+ "start": {
+ "line": 40,
+ "column": 5
+ },
+ "end": {
+ "line": 48,
+ "column": 1
+ },
+ "name": "toplevelFunction4",
+ "kind": "function",
+ "isStackFrame": true,
+ "variables": [],
+ "children": []
+ }
+ ]
+ }
+ ]
}
],
"ranges": []
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/single-root-original-scope.map b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map
index 3b03b4ef6d0..a8884df13a0 100644
--- a/test/fixtures/test426/decoding/scopes/single-root-original-scope.map
+++ b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map
@@ -8,5 +8,6 @@
"names": [
"global"
],
- "scopes": "BCAAA,CKA,ECAA,FK"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,CKA"],
+ "ranges": ["ECAAA,FK"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden
index 9516233dc5a..d9b047cad55 100644
--- a/test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden
+++ b/test/fixtures/test426/decoding/scopes/single-root-original-scope.map.golden
@@ -6,21 +6,23 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [],
- "children": []
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [],
+ "children": []
+ }
+ ]
}
],
"ranges": [
@@ -33,11 +35,14 @@
"line": 0,
"column": 10
},
- "definitionIndex": 0,
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [],
"children": []
}
]
-}
\ No newline at end of file
+}
diff --git a/test/fixtures/test426/decoding/scopes/sub-range-values.map b/test/fixtures/test426/decoding/scopes/sub-range-values.map
index 40155a81938..625cf952db1 100644
--- a/test/fixtures/test426/decoding/scopes/sub-range-values.map
+++ b/test/fixtures/test426/decoding/scopes/sub-range-values.map
@@ -13,5 +13,6 @@
"y_val",
"x_sub_val2"
],
- "scopes": "BCAAA,DCC,CKA,ECAA,GEF,HAADAADG,FK"
-}
\ No newline at end of file
+ "scopes": ["BCAAA,DCC,CKA"],
+ "ranges": ["ECAAA,GEF,HAADAADG,FK"]
+}
diff --git a/test/fixtures/test426/decoding/scopes/sub-range-values.map.golden b/test/fixtures/test426/decoding/scopes/sub-range-values.map.golden
index c0662102819..dda9a4b780a 100644
--- a/test/fixtures/test426/decoding/scopes/sub-range-values.map.golden
+++ b/test/fixtures/test426/decoding/scopes/sub-range-values.map.golden
@@ -6,24 +6,26 @@
"url": "original_0.js",
"content": null,
"ignored": false,
- "scope": {
- "start": {
- "line": 0,
- "column": 0
- },
- "end": {
- "line": 10,
- "column": 0
- },
- "name": null,
- "kind": "global",
- "isStackFrame": false,
- "variables": [
- "x",
- "y"
- ],
- "children": []
- }
+ "rootScopes": [
+ {
+ "start": {
+ "line": 0,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ },
+ "name": null,
+ "kind": "global",
+ "isStackFrame": false,
+ "variables": [
+ "x",
+ "y"
+ ],
+ "children": []
+ }
+ ]
}
],
"ranges": [
@@ -36,7 +38,10 @@
"line": 0,
"column": 10
},
- "definitionIndex": 0,
+ "definition": {
+ "source": 0,
+ "scope": 0
+ },
"stackFrameType": "none",
"callSite": null,
"bindings": [
@@ -76,4 +81,4 @@
"children": []
}
]
-}
\ No newline at end of file
+}
diff --git a/test/test426/README.md b/test/test426/README.md
index 2bc52a566ba..6935fc43c3d 100644
--- a/test/test426/README.md
+++ b/test/test426/README.md
@@ -7,7 +7,7 @@ suite ensures that the Node.js source map implementation conforms to the
The [`test/fixtures/test426`](../fixtures/test426/) contains a copy of the set of
[Source Map Tests][] suite. The last updated hash is:
-* <https://github.com/tc39/source-map-tests/commit/2965987bf4c96afa400c9356c8e620cb340aaee2>
+* <https://github.com/tc39/source-map-tests/commit/9ea66b466fd37e8a4050033d23b3e1480973c3dc>
See the json files in [the `status` folder](./status) for prerequisites,
expected failures, and support status for specific tests.