@@ -1392,20 +1392,7 @@ void jscoverage_instrument_js(const char * id, const uint16_t * characters, size
1392
1392
1393
1393
/* write line number info to the output */
1394
1394
Stream_write_string (output, " /* automatically generated by JSCoverage - do not edit */\n " );
1395
- if (jscoverage_mozilla) {
1396
- Stream_write_string (output, " try {\n " );
1397
- Stream_write_string (output, " Components.utils.import('resource://gre/modules/jscoverage.jsm');\n " );
1398
- Stream_printf (output, " dump('%s: successfully imported jscoverage module\\ n');\n " , id);
1399
- Stream_write_string (output, " }\n " );
1400
- Stream_write_string (output, " catch (e) {\n " );
1401
- Stream_write_string (output, " _$jscoverage = {};\n " );
1402
- Stream_printf (output, " dump('%s: failed to import jscoverage module - coverage not available for this file\\ n');\n " , id);
1403
- Stream_write_string (output, " }\n " );
1404
- }
1405
- else {
1406
- Stream_write_string (output, " if (! top._$jscoverage) {\n top._$jscoverage = {};\n }\n " );
1407
- Stream_write_string (output, " var _$jscoverage = top._$jscoverage;\n " );
1408
- }
1395
+ Stream_write_string (output, " if (typeof _$jscoverage === 'undefined') _$jscoverage = {};\n " );
1409
1396
Stream_printf (output, " if (! _$jscoverage['%s']) {\n " , file_id);
1410
1397
Stream_printf (output, " _$jscoverage['%s'] = [];\n " , file_id);
1411
1398
for (int i = 0 ; i < num_lines; i++) {
0 commit comments