Commit f0709fd
module: add SourceMap.findOrigin
This adds the `SourceMap.findOrigin(lineNumber, columnNumber)` method,
for finding the origin source file and 1-indexed line and column numbers
corresponding to the 1-indexed line and column numbers from a call site
in generated source code.
Fix: #47770
PR-URL: #47790
Fixes: #47770
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>1 parent 112335e commit f0709fdCopy full SHA for f0709fd
File tree
Expand file treeCollapse file tree
3 files changed
+115
-22
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/source_map
- test/parallel
Expand file treeCollapse file tree
3 files changed
+115
-22
lines changedOpen diff view settings
Collapse file
+56-12Lines changed: 56 additions & 12 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
198 | 198 | |
199 | 199 | |
200 | 200 | |
201 | | - |
| 201 | + |
202 | 202 | |
203 | | - |
204 | | - |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
205 | 207 | |
206 | 208 | |
207 | | - |
208 | | - |
209 | | - |
210 | | - |
211 | | - |
212 | | - |
213 | | - |
214 | | - |
215 | | - |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
216 | 225 | |
217 | 226 | |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
218 | 262 | |
219 | 263 | |
220 | 264 | |
|
Collapse file
lib/internal/source_map/source_map.js
Copy file name to clipboardExpand all lines: lib/internal/source_map/source_map.js+34-8Lines changed: 34 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
169 | 169 | |
170 | 170 | |
171 | 171 | |
172 | | - |
173 | | - |
174 | | - |
| 172 | + |
| 173 | + |
| 174 | + |
175 | 175 | |
176 | | - |
| 176 | + |
177 | 177 | |
178 | 178 | |
179 | 179 | |
180 | 180 | |
181 | 181 | |
182 | 182 | |
183 | | - |
184 | | - |
| 183 | + |
| 184 | + |
185 | 185 | |
186 | 186 | |
187 | 187 | |
188 | 188 | |
189 | 189 | |
190 | 190 | |
191 | 191 | |
192 | | - |
193 | | - |
| 192 | + |
| 193 | + |
194 | 194 | |
195 | 195 | |
196 | 196 | |
| ||
205 | 205 | |
206 | 206 | |
207 | 207 | |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
208 | 234 | |
209 | 235 | |
210 | 236 | |
|
Collapse file
test/parallel/test-source-map-api.js
Copy file name to clipboardExpand all lines: test/parallel/test-source-map-api.js+25-2Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
49 | 49 | |
50 | 50 | |
51 | 51 | |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
52 | 60 | |
53 | 61 | |
54 | 62 | |
| ||
89 | 97 | |
90 | 98 | |
91 | 99 | |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
92 | 112 | |
93 | 113 | |
94 | 114 | |
| ||
112 | 132 | |
113 | 133 | |
114 | 134 | |
115 | | - |
116 | | - |
| 135 | + |
| 136 | + |
117 | 137 | |
118 | 138 | |
119 | 139 | |
| ||
124 | 144 | |
125 | 145 | |
126 | 146 | |
| 147 | + |
| 148 | + |
| 149 | + |
127 | 150 | |
128 | 151 | |
129 | 152 | |
|
0 commit comments