/[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 348 by siliconforks, Fri Oct 24 16:17:00 2008 UTC revision 349 by siliconforks, Fri Oct 24 16:17:19 2008 UTC
# Line 583  Line 583 
583      assert(ATOM_IS_STRING(node->pn_atom));      assert(ATOM_IS_STRING(node->pn_atom));
584      {      {
585        JSString * s = ATOM_TO_STRING(node->pn_atom);        JSString * s = ATOM_TO_STRING(node->pn_atom);
586        bool is_keyword = (js_CheckKeyword(JSSTRING_CHARS(s), JSSTRING_LENGTH(s)) != TOK_EOF);        bool must_quote;
587        if (! is_keyword && js_IsIdentifier(s)) {        if (JSSTRING_LENGTH(s) == 0) {
588          Stream_write_char(f, '.');          must_quote = true;
589          print_string_atom(node->pn_atom, f);        }
590          else if (js_CheckKeyword(JSSTRING_CHARS(s), JSSTRING_LENGTH(s)) != TOK_EOF) {
591            must_quote = true;
592          }
593          else if (! js_IsIdentifier(s)) {
594            must_quote = true;
595        }        }
596        else {        else {
597            must_quote = false;
598          }
599          if (must_quote) {
600          Stream_write_char(f, '[');          Stream_write_char(f, '[');
601          print_quoted_string_atom(node->pn_atom, f);          print_quoted_string_atom(node->pn_atom, f);
602          Stream_write_char(f, ']');          Stream_write_char(f, ']');
603        }        }
604          else {
605            Stream_write_char(f, '.');
606            print_string_atom(node->pn_atom, f);
607          }
608      }      }
609      break;      break;
610    case TOK_LB:    case TOK_LB:

Legend:
Removed from v.348  
changed lines
  Added in v.349

  ViewVC Help
Powered by ViewVC 1.1.24