/[jscoverage]/trunk/instrument-js.cpp
ViewVC logotype

Diff of /trunk/instrument-js.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 493 by siliconforks, Thu Oct 8 23:53:18 2009 UTC revision 494 by siliconforks, Sun Dec 27 17:24:41 2009 UTC
# Line 1501  Line 1501 
1501      Stream_write_string(output, "}\n");      Stream_write_string(output, "}\n");
1502      break;      break;
1503    case JSCOVERAGE_NORMAL:    case JSCOVERAGE_NORMAL:
1504      Stream_write_string(output, "if (! top._$jscoverage) {\n  top._$jscoverage = {};\n}\n");      /*
1505      Stream_write_string(output, "var _$jscoverage = top._$jscoverage;\n");      // pseudo-code:
1506        if (top && top.opener && top.opener._$jscoverage) {
1507          var _$jscoverage = top._$jscoverage = top.opener._$jscoverage;
1508        }
1509        else if (top && top.opener) {
1510          var _$jscoverage = top._$jscoverage = top.opener._$jscoverage = {};
1511        }
1512        else if (top && top._$jscoverage) {
1513          var _$jscoverage = top._$jscoverage;
1514        }
1515        else if (top) {
1516          var _$jscoverage = top._$jscoverage = {};
1517        }
1518        else if (_$jscoverage) {
1519          // nothing to do!
1520        }
1521        else {
1522          var _$jscoverage = {};
1523        }
1524        */
1525        const struct Resource * resource = get_resource("header.js");
1526        Stream_write(output, resource->data, resource->length);
1527      break;      break;
1528    case JSCOVERAGE_NO_BROWSER:    case JSCOVERAGE_NO_BROWSER:
1529      Stream_write_string(output, "if (typeof _$jscoverage === 'undefined') {\n  var _$jscoverage = {};\n}\n");      Stream_write_string(output, "if (typeof _$jscoverage === 'undefined') {\n  var _$jscoverage = {};\n}\n");

Legend:
Removed from v.493  
changed lines
  Added in v.494

  ViewVC Help
Powered by ViewVC 1.1.24