@@ -100,9 +100,11 @@ describeWithEnvironment('SourceMap', () => {
100100 } ) ;
101101
102102 function assertMapping (
103- actual : SDK . SourceMap . SourceMapEntry | null , expectedSourceURL : string | undefined ,
104- expectedSourceLineNumber : number | undefined , expectedSourceColumnNumber : number | undefined ) {
103+ actual : SDK . SourceMap . SourceMapEntry | null , expectedSourceIndex : number | undefined ,
104+ expectedSourceURL : string | undefined , expectedSourceLineNumber : number | undefined ,
105+ expectedSourceColumnNumber : number | undefined ) {
105106 assert . exists ( actual ) ;
107+ assert . strictEqual ( actual . sourceIndex , expectedSourceIndex , 'unexpected source index' ) ;
106108 assert . strictEqual ( actual . sourceURL , expectedSourceURL , 'unexpected source URL' ) ;
107109 assert . strictEqual ( actual . sourceLineNumber , expectedSourceLineNumber , 'unexpected source line number' ) ;
108110 assert . strictEqual ( actual . sourceColumnNumber , expectedSourceColumnNumber , 'unexpected source column number' ) ;
@@ -163,13 +165,13 @@ describeWithEnvironment('SourceMap', () => {
163165
164166 const sourceMap = new SDK . SourceMap . SourceMap ( compiledUrl , sourceMapJsonUrl , mappingPayload ) ;
165167
166- assertMapping ( sourceMap . findEntry ( 0 , 9 ) , 'example.js' , 0 , 9 ) ;
167- assertMapping ( sourceMap . findEntry ( 0 , 13 ) , 'example.js' , 0 , 13 ) ;
168- assertMapping ( sourceMap . findEntry ( 0 , 15 ) , 'example.js' , 0 , 25 ) ;
169- assertMapping ( sourceMap . findEntry ( 0 , 18 ) , 'example.js' , 2 , 4 ) ;
170- assertMapping ( sourceMap . findEntry ( 0 , 25 ) , 'example.js' , 2 , 11 ) ;
171- assertMapping ( sourceMap . findEntry ( 0 , 27 ) , 'example.js' , 2 , 24 ) ;
172- assertMapping ( sourceMap . findEntry ( 1 , 0 ) , undefined , undefined , undefined ) ;
168+ assertMapping ( sourceMap . findEntry ( 0 , 9 ) , 0 , 'example.js' , 0 , 9 ) ;
169+ assertMapping ( sourceMap . findEntry ( 0 , 13 ) , 0 , 'example.js' , 0 , 13 ) ;
170+ assertMapping ( sourceMap . findEntry ( 0 , 15 ) , 0 , 'example.js' , 0 , 25 ) ;
171+ assertMapping ( sourceMap . findEntry ( 0 , 18 ) , 0 , 'example.js' , 2 , 4 ) ;
172+ assertMapping ( sourceMap . findEntry ( 0 , 25 ) , 0 , 'example.js' , 2 , 11 ) ;
173+ assertMapping ( sourceMap . findEntry ( 0 , 27 ) , 0 , 'example.js' , 2 , 24 ) ;
174+ assertMapping ( sourceMap . findEntry ( 1 , 0 ) , undefined , undefined , undefined , undefined ) ;
173175
174176 assertReverseMapping ( sourceMap . sourceLineMapping ( sourceUrlExample , 0 , 0 ) , 0 , 0 ) ;
175177 assertReverseMapping ( sourceMap . sourceLineMapping ( sourceUrlExample , 1 , 0 ) , 0 , 17 ) ;
@@ -269,8 +271,8 @@ describeWithEnvironment('SourceMap', () => {
269271 } ;
270272 const sourceMap = new SDK . SourceMap . SourceMap ( compiledUrl , sourceMapJsonUrl , mappingPayload ) ;
271273
272- assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 'example.js' , 0 , 0 ) ;
273- assertMapping ( sourceMap . findEntry ( 0 , 2 ) , 'example.js' , 0 , 2 ) ;
274+ assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 0 , 'example.js' , 0 , 0 ) ;
275+ assertMapping ( sourceMap . findEntry ( 0 , 2 ) , 0 , 'example.js' , 0 , 2 ) ;
274276
275277 const emptyEntry = sourceMap . findEntry ( 0 , 1 ) ;
276278 assert . exists ( emptyEntry ) ;
@@ -287,7 +289,7 @@ describeWithEnvironment('SourceMap', () => {
287289 } ;
288290 const sourceMap = new SDK . SourceMap . SourceMap ( compiledUrl , sourceMapJsonUrl , mappingPayload ) ;
289291
290- assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 'example.js' , 0 , 0 ) ;
292+ assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 0 , 'example.js' , 0 , 0 ) ;
291293 assertReverseMapping ( sourceMap . sourceLineMapping ( sourceUrlExample , 1 , 0 ) , 3 , 1 ) ;
292294 } ) ;
293295
@@ -306,10 +308,10 @@ describeWithEnvironment('SourceMap', () => {
306308 version : 3 ,
307309 } ) ;
308310
309- assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 'example.js' , 0 , 3 ) ;
310- assertMapping ( sourceMap . findEntry ( 0 , 1 ) , 'example.js' , 0 , 2 ) ;
311- assertMapping ( sourceMap . findEntry ( 0 , 2 ) , 'example.js' , 0 , 1 ) ;
312- assertMapping ( sourceMap . findEntry ( 0 , 3 ) , 'example.js' , 0 , 0 ) ;
311+ assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 0 , 'example.js' , 0 , 3 ) ;
312+ assertMapping ( sourceMap . findEntry ( 0 , 1 ) , 0 , 'example.js' , 0 , 2 ) ;
313+ assertMapping ( sourceMap . findEntry ( 0 , 2 ) , 0 , 'example.js' , 0 , 1 ) ;
314+ assertMapping ( sourceMap . findEntry ( 0 , 3 ) , 0 , 'example.js' , 0 , 0 ) ;
313315 } ) ;
314316
315317 it ( 'can parse the multiple sections format' , ( ) => {
@@ -337,10 +339,10 @@ describeWithEnvironment('SourceMap', () => {
337339 const sourceMap = new SDK . SourceMap . SourceMap ( compiledUrl , sourceMapJsonUrl , mappingPayload ) ;
338340
339341 assert . lengthOf ( sourceMap . sourceURLs ( ) , 3 , 'unexpected number of original source URLs' ) ;
340- assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 'source1.js' , 0 , 0 ) ;
341- assertMapping ( sourceMap . findEntry ( 0 , 1 ) , 'source1.js' , 2 , 1 ) ;
342- assertMapping ( sourceMap . findEntry ( 2 , 10 ) , 'source3.js' , 0 , 0 ) ;
343- assertMapping ( sourceMap . findEntry ( 2 , 11 ) , 'source3.js' , 2 , 1 ) ;
342+ assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 0 , 'source1.js' , 0 , 0 ) ;
343+ assertMapping ( sourceMap . findEntry ( 0 , 1 ) , 0 , 'source1.js' , 2 , 1 ) ;
344+ assertMapping ( sourceMap . findEntry ( 2 , 10 ) , 0 , 'source3.js' , 0 , 0 ) ;
345+ assertMapping ( sourceMap . findEntry ( 2 , 11 ) , 0 , 'source3.js' , 2 , 1 ) ;
344346 } ) ;
345347
346348 it ( 'can parse source maps with ClosureScript names' , ( ) => {
@@ -407,8 +409,9 @@ describeWithEnvironment('SourceMap', () => {
407409 const sourceMapJsonUrl = urlString `wp://test/source-map.json` ;
408410 const sourceMap = new SDK . SourceMap . SourceMap ( compiledUrl , sourceMapJsonUrl , mappingPayload ) ;
409411
410- assertMapping ( sourceMap . findEntry ( 1 , 0 ) , 'wp:///example.js' , 3 , 0 ) ;
411- assertMapping ( sourceMap . findEntry ( 4 , 0 ) , 'wp:///other.js' , 5 , 0 ) ;
412+ assertMapping ( sourceMap . findEntry ( 0 , 0 ) , 0 , 'wp:///example.js' , 1 , 0 ) ;
413+ assertMapping ( sourceMap . findEntry ( 1 , 0 ) , 1 , 'wp:///example.js' , 3 , 0 ) ;
414+ assertMapping ( sourceMap . findEntry ( 4 , 0 ) , 2 , 'wp:///other.js' , 5 , 0 ) ;
412415 } ) ;
413416
414417 describe ( 'compatibleForURL' , ( ) => {
0 commit comments