/[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 380 by siliconforks, Wed Oct 29 00:10:22 2008 UTC revision 389 by siliconforks, Thu Oct 30 17:53:07 2008 UTC
# Line 22  Line 22 
22  #include "instrument-js.h"  #include "instrument-js.h"
23    
24  #include <assert.h>  #include <assert.h>
25    #include <math.h>
26  #include <stdlib.h>  #include <stdlib.h>
27  #include <string.h>  #include <string.h>
28    
# Line 550  Line 551 
551    case TOK_UNARYOP:    case TOK_UNARYOP:
552      switch (node->pn_op) {      switch (node->pn_op) {
553      case JSOP_NEG:      case JSOP_NEG:
554        Stream_write_char(f, '-');        Stream_write_string(f, "- ");
555        output_expression(node->pn_kid, f, false);        output_expression(node->pn_kid, f, false);
556        break;        break;
557      case JSOP_POS:      case JSOP_POS:
558        Stream_write_char(f, '+');        Stream_write_string(f, "+ ");
559        output_expression(node->pn_kid, f, false);        output_expression(node->pn_kid, f, false);
560        break;        break;
561      case JSOP_NOT:      case JSOP_NOT:
562        Stream_write_char(f, '!');        Stream_write_string(f, "! ");
563        output_expression(node->pn_kid, f, false);        output_expression(node->pn_kid, f, false);
564        break;        break;
565      case JSOP_BITNOT:      case JSOP_BITNOT:
566        Stream_write_char(f, '~');        Stream_write_string(f, "~ ");
567        output_expression(node->pn_kid, f, false);        output_expression(node->pn_kid, f, false);
568        break;        break;
569      case JSOP_TYPEOF:      case JSOP_TYPEOF:
# Line 765  Line 766 
766      if (node->pn_dval == 0.0) {      if (node->pn_dval == 0.0) {
767        Stream_write_string(f, "0");        Stream_write_string(f, "0");
768      }      }
769        else if (node->pn_dval == INFINITY) {
770          Stream_write_string(f, "Number.POSITIVE_INFINITY");
771        }
772        else if (node->pn_dval == -INFINITY) {
773          Stream_write_string(f, "Number.NEGATIVE_INFINITY");
774        }
775        else if (node->pn_dval == NAN) {
776          Stream_write_string(f, "Number.NaN");
777        }
778      else {      else {
779        Stream_printf(f, "%.15g", node->pn_dval);        Stream_printf(f, "%.15g", node->pn_dval);
780      }      }

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

  ViewVC Help
Powered by ViewVC 1.1.24