@@ -1392,20 +1392,7 @@ void jscoverage_instrument_js(const char * id, const uint16_t * characters, size
13921392
13931393 /* write line number info to the output */
13941394 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 " );
14091396 Stream_printf (output, " if (! _$jscoverage['%s']) {\n " , file_id);
14101397 Stream_printf (output, " _$jscoverage['%s'] = [];\n " , file_id);
14111398 for (int i = 0 ; i < num_lines; i++) {
0 commit comments