@@ -168,9 +168,7 @@ class InspectorSession {
168168 reject ( message . error ) ;
169169 } else {
170170 if ( message . method === 'Debugger.scriptParsed' ) {
171- const script = message [ 'params' ] ;
172- const scriptId = script [ 'scriptId' ] ;
173- const url = script [ 'url' ] ;
171+ const { scriptId, url } = message . params ;
174172 this . _scriptsIdsByUrl . set ( scriptId , url ) ;
175173 const fileUrl = url . startsWith ( 'file:' ) ?
176174 url : getURLFromFilePath ( url ) . toString ( ) ;
@@ -192,12 +190,12 @@ class InspectorSession {
192190
193191 _sendMessage ( message ) {
194192 const msg = JSON . parse ( JSON . stringify ( message ) ) ; // Clone!
195- msg [ 'id' ] = this . _nextId ++ ;
193+ msg . id = this . _nextId ++ ;
196194 if ( DEBUG )
197195 console . log ( '[sent]' , JSON . stringify ( msg ) ) ;
198196
199197 const responsePromise = new Promise ( ( resolve , reject ) => {
200- this . _commandResponsePromises . set ( msg [ 'id' ] , { resolve, reject } ) ;
198+ this . _commandResponsePromises . set ( msg . id , { resolve, reject } ) ;
201199 } ) ;
202200
203201 return new Promise (
@@ -243,14 +241,14 @@ class InspectorSession {
243241 }
244242
245243 _isBreakOnLineNotification ( message , line , expectedScriptPath ) {
246- if ( 'Debugger.paused' === message [ ' method' ] ) {
247- const callFrame = message [ ' params' ] [ ' callFrames' ] [ 0 ] ;
248- const location = callFrame [ ' location' ] ;
249- const scriptPath = this . _scriptsIdsByUrl . get ( location [ ' scriptId' ] ) ;
244+ if ( 'Debugger.paused' === message . method ) {
245+ const callFrame = message . params . callFrames [ 0 ] ;
246+ const location = callFrame . location ;
247+ const scriptPath = this . _scriptsIdsByUrl . get ( location . scriptId ) ;
250248 assert . strictEqual ( scriptPath . toString ( ) ,
251249 expectedScriptPath . toString ( ) ,
252250 `${ scriptPath } !== ${ expectedScriptPath } ` ) ;
253- assert . strictEqual ( line , location [ ' lineNumber' ] ) ;
251+ assert . strictEqual ( line , location . lineNumber ) ;
254252 return true ;
255253 }
256254 }
@@ -266,12 +264,12 @@ class InspectorSession {
266264 _matchesConsoleOutputNotification ( notification , type , values ) {
267265 if ( ! Array . isArray ( values ) )
268266 values = [ values ] ;
269- if ( 'Runtime.consoleAPICalled' === notification [ ' method' ] ) {
270- const params = notification [ ' params' ] ;
271- if ( params [ ' type' ] === type ) {
267+ if ( 'Runtime.consoleAPICalled' === notification . method ) {
268+ const params = notification . params ;
269+ if ( params . type === type ) {
272270 let i = 0 ;
273- for ( const value of params [ ' args' ] ) {
274- if ( value [ ' value' ] !== values [ i ++ ] )
271+ for ( const value of params . args ) {
272+ if ( value . value !== values [ i ++ ] )
275273 return false ;
276274 }
277275 return i === values . length ;
@@ -392,7 +390,7 @@ class NodeInstance {
392390
393391 async sendUpgradeRequest ( ) {
394392 const response = await this . httpGet ( null , '/json/list' ) ;
395- const devtoolsUrl = response [ 0 ] [ ' webSocketDebuggerUrl' ] ;
393+ const devtoolsUrl = response [ 0 ] . webSocketDebuggerUrl ;
396394 const port = await this . portPromise ;
397395 return http . get ( {
398396 port,
0 commit comments