/[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 2 by siliconforks, Wed Aug 1 13:51:53 2007 UTC revision 70 by siliconforks, Thu Nov 22 02:52:38 2007 UTC
# Line 794  Line 794 
794    output_statement(node, f, indent);    output_statement(node, f, indent);
795  }  }
796    
797  static void instrument_js_stream(const char * id, int line, FILE * input, FILE * output) {  static void instrument_js_stream(const char * id, int line, FILE * input, FILE * output, const char * temporary_file_name) {
798    file_id = id;    file_id = id;
799    
800    /* scan the javascript */    /* scan the javascript */
# Line 818  Line 818 
818    Create a temporary file - we can't write directly to the output because we    Create a temporary file - we can't write directly to the output because we
819    need to know the line number info first.    need to know the line number info first.
820    */    */
821    FILE * temporary = tmpfile();    FILE * temporary = fopen(temporary_file_name, "w+");
822    if (temporary == NULL) {    if (temporary == NULL) {
823      fatal("cannot create temporary file for script: %s", file_id);      fatal("cannot create temporary file for script: %s", file_id);
824    }    }
# Line 849  Line 849 
849    file_id = NULL;    file_id = NULL;
850  }  }
851    
852  void jscoverage_instrument_js(const char * id, FILE * input, FILE * output) {  void jscoverage_instrument_js(const char * id, FILE * input, FILE * output, const char * temporary_file_name) {
853    instrument_js_stream(id, 0, input, output);    instrument_js_stream(id, 0, input, output, temporary_file_name);
854  }  }

Legend:
Removed from v.2  
changed lines
  Added in v.70

  ViewVC Help
Powered by ViewVC 1.1.24