@@ -5,9 +5,8 @@ const fs = require('fs');
5
5
const http = require ( 'http' ) ;
6
6
const fixtures = require ( '../common/fixtures' ) ;
7
7
const { spawn } = require ( 'child_process' ) ;
8
- const { URL , parse : parseURL } = require ( 'url' ) ;
8
+ const { parse : parseURL } = require ( 'url' ) ;
9
9
const { getURLFromFilePath } = require ( 'internal/url' ) ;
10
- const path = require ( 'path' ) ;
11
10
12
11
const _MAINSCRIPT = fixtures . path ( 'loop.js' ) ;
13
12
const DEBUG = false ;
@@ -173,7 +172,9 @@ class InspectorSession {
173
172
const scriptId = script [ 'scriptId' ] ;
174
173
const url = script [ 'url' ] ;
175
174
this . _scriptsIdsByUrl . set ( scriptId , url ) ;
176
- if ( getURLFromFilePath ( url ) . toString ( ) === this . scriptURL ( ) . toString ( ) ) {
175
+ const fileUrl = url . startsWith ( 'file:' ) ?
176
+ url : getURLFromFilePath ( url ) . toString ( ) ;
177
+ if ( fileUrl === this . scriptURL ( ) . toString ( ) ) {
177
178
this . mainScriptId = scriptId ;
178
179
}
179
180
}
@@ -246,8 +247,9 @@ class InspectorSession {
246
247
const callFrame = message [ 'params' ] [ 'callFrames' ] [ 0 ] ;
247
248
const location = callFrame [ 'location' ] ;
248
249
const scriptPath = this . _scriptsIdsByUrl . get ( location [ 'scriptId' ] ) ;
249
- assert ( scriptPath . toString ( ) === expectedScriptPath . toString ( ) ,
250
- `${ scriptPath } !== ${ expectedScriptPath } ` ) ;
250
+ assert . strictEqual ( scriptPath . toString ( ) ,
251
+ expectedScriptPath . toString ( ) ,
252
+ `${ scriptPath } !== ${ expectedScriptPath } ` ) ;
251
253
assert . strictEqual ( line , location [ 'lineNumber' ] ) ;
252
254
return true ;
253
255
}
0 commit comments