File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -467,7 +467,8 @@ class Driver {
467
467
}
468
468
469
469
async initialize ( ) {
470
- window . addEventListener ( "error" , ( e ) => this . pushError ( "driver startup" , e . error ) ) ;
470
+ if ( isInBrowser )
471
+ window . addEventListener ( "error" , ( e ) => this . pushError ( "driver startup" , e . error ) ) ;
471
472
await this . prefetchResourcesForBrowser ( ) ;
472
473
await this . fetchResources ( ) ;
473
474
this . prepareToRun ( ) ;
@@ -529,11 +530,14 @@ class Driver {
529
530
}
530
531
531
532
resultsObject ( format = "run-benchmark" ) {
532
- if ( format == "run-benchmark" )
533
- return this . runBenchmarkResultsObject ( ) ;
534
- if ( format != "simple" )
535
- throw Error ( `Unknown result format '${ format } '` ) ;
536
- return this . simpleResultsObject ( ) ;
533
+ switch ( format ) {
534
+ case "run-benchmark" :
535
+ return this . runBenchmarkResultsObject ( ) ;
536
+ case "simple" :
537
+ return this . simpleResultsObject ( ) ;
538
+ default :
539
+ throw Error ( `Unknown result format '${ format } '` ) ;
540
+ }
537
541
}
538
542
539
543
runBenchmarkResultsObject ( )
You can’t perform that action at this time.
0 commit comments