@@ -5,9 +5,8 @@ const fs = require('fs');
55const http = require ( 'http' ) ;
66const fixtures = require ( '../common/fixtures' ) ;
77const { spawn } = require ( 'child_process' ) ;
8- const { URL , parse : parseURL } = require ( 'url' ) ;
8+ const { parse : parseURL } = require ( 'url' ) ;
99const { getURLFromFilePath } = require ( 'internal/url' ) ;
10- const path = require ( 'path' ) ;
1110
1211const _MAINSCRIPT = fixtures . path ( 'loop.js' ) ;
1312const DEBUG = false ;
@@ -173,7 +172,9 @@ class InspectorSession {
173172 const scriptId = script [ 'scriptId' ] ;
174173 const url = script [ 'url' ] ;
175174 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 ( ) ) {
177178 this . mainScriptId = scriptId ;
178179 }
179180 }
@@ -246,8 +247,9 @@ class InspectorSession {
246247 const callFrame = message [ 'params' ] [ 'callFrames' ] [ 0 ] ;
247248 const location = callFrame [ 'location' ] ;
248249 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 } ` ) ;
251253 assert . strictEqual ( line , location [ 'lineNumber' ] ) ;
252254 return true ;
253255 }
0 commit comments