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

Diff of /trunk/instrument-js.c

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

revision 379 by siliconforks, Tue Oct 28 17:50:42 2008 UTC revision 380 by siliconforks, Wed Oct 29 00:10:22 2008 UTC
# Line 414  Line 414 
414      }      }
415    }    }
416    
417    Stream_write_string(f, "}\n");    Stream_write_char(f, '}');
418  }  }
419    
420  static void instrument_function_call(JSParseNode * node, Stream * f) {  static void instrument_function_call(JSParseNode * node, Stream * f) {
# Line 433  Line 433 
433        Stream_write_char(f, ')');        Stream_write_char(f, ')');
434        return;        return;
435      }      }
     else {  
       Stream_write_char(f, '(');  
       output_expression(function_node, f, false);  
       Stream_write_char(f, ')');  
     }  
   }  
   else {  
     output_expression(function_node, f, false);  
436    }    }
437      output_expression(function_node, f, false);
438    Stream_write_char(f, '(');    Stream_write_char(f, '(');
439    for (struct JSParseNode * p = function_node->pn_next; p != NULL; p = p->pn_next) {    for (struct JSParseNode * p = function_node->pn_next; p != NULL; p = p->pn_next) {
440      if (p != node->pn_head->pn_next) {      if (p != node->pn_head->pn_next) {
# Line 478  Line 471 
471  static void output_expression(JSParseNode * node, Stream * f, bool parenthesize_object_literals) {  static void output_expression(JSParseNode * node, Stream * f, bool parenthesize_object_literals) {
472    switch (node->pn_type) {    switch (node->pn_type) {
473    case TOK_FUNCTION:    case TOK_FUNCTION:
474        Stream_write_char(f, '(');
475      instrument_function(node, f, 0, FUNCTION_NORMAL);      instrument_function(node, f, 0, FUNCTION_NORMAL);
476        Stream_write_char(f, ')');
477      break;      break;
478    case TOK_COMMA:    case TOK_COMMA:
479      for (struct JSParseNode * p = node->pn_head; p != NULL; p = p->pn_next) {      for (struct JSParseNode * p = node->pn_head; p != NULL; p = p->pn_next) {
# Line 861  Line 856 
856    switch (node->pn_type) {    switch (node->pn_type) {
857    case TOK_FUNCTION:    case TOK_FUNCTION:
858      instrument_function(node, f, indent, FUNCTION_NORMAL);      instrument_function(node, f, indent, FUNCTION_NORMAL);
859        Stream_write_char(f, '\n');
860      break;      break;
861    case TOK_LC:    case TOK_LC:
862      assert(node->pn_arity == PN_LIST);      assert(node->pn_arity == PN_LIST);

Legend:
Removed from v.379  
changed lines
  Added in v.380

  ViewVC Help
Powered by ViewVC 1.1.24