/[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 506 by siliconforks, Sat Jan 2 04:55:54 2010 UTC revision 507 by siliconforks, Sun Jan 10 07:23:34 2010 UTC
# Line 141  Line 141 
141  }  }
142    
143  static void print_string(JSString * s, Stream * f) {  static void print_string(JSString * s, Stream * f) {
144    size_t length = JSSTRING_LENGTH(s);    size_t length;
145    jschar * characters = JSSTRING_CHARS(s);    const jschar * characters;
146      s->getCharsAndLength(characters, length);
147    for (size_t i = 0; i < length; i++) {    for (size_t i = 0; i < length; i++) {
148      jschar c = characters[i];      jschar c = characters[i];
149      if (32 <= c && c <= 126) {      if (32 <= c && c <= 126) {
# Line 203  Line 204 
204  static void print_regex(jsval value, Stream * f) {  static void print_regex(jsval value, Stream * f) {
205    assert(JSVAL_IS_STRING(value));    assert(JSVAL_IS_STRING(value));
206    JSString * s = JSVAL_TO_STRING(value);    JSString * s = JSVAL_TO_STRING(value);
207    size_t length = JSSTRING_LENGTH(s);    size_t length;
208    jschar * characters = JSSTRING_CHARS(s);    const jschar * characters;
209      s->getCharsAndLength(characters, length);
210    for (size_t i = 0; i < length; i++) {    for (size_t i = 0; i < length; i++) {
211      jschar c = characters[i];      jschar c = characters[i];
212      if (32 <= c && c <= 126) {      if (32 <= c && c <= 126) {
# Line 416  Line 418 
418        for (JSParseNode * p = comma->pn_head; p != NULL; p = p->pn_next) {        for (JSParseNode * p = comma->pn_head; p != NULL; p = p->pn_next) {
419          assert(p->pn_type == TOK_ASSIGN);          assert(p->pn_type == TOK_ASSIGN);
420          JSParseNode * rhs = p->pn_right;          JSParseNode * rhs = p->pn_right;
421          assert(JSSTRING_LENGTH(ATOM_TO_STRING(rhs->pn_atom)) == 0);          assert(ATOM_TO_STRING(rhs->pn_atom)->length() == 0);
422          if (UPVAR_FRAME_SLOT(rhs->pn_cookie) == i) {          if (UPVAR_FRAME_SLOT(rhs->pn_cookie) == i) {
423            expression = p->pn_left;            expression = p->pn_left;
424            break;            break;
# Line 755  Line 757 
757      {      {
758        JSString * s = ATOM_TO_STRING(node->pn_atom);        JSString * s = ATOM_TO_STRING(node->pn_atom);
759        bool must_quote;        bool must_quote;
760        if (JSSTRING_LENGTH(s) == 0) {  
761          size_t length;
762          const jschar * characters;
763          s->getCharsAndLength(characters, length);
764    
765          if (length == 0) {
766          must_quote = true;          must_quote = true;
767        }        }
768        else if (js_CheckKeyword(JSSTRING_CHARS(s), JSSTRING_LENGTH(s)) != TOK_EOF) {        else if (js_CheckKeyword(characters, length) != TOK_EOF) {
769          must_quote = true;          must_quote = true;
770        }        }
771        else if (! js_IsIdentifier(s)) {        else if (! js_IsIdentifier(s)) {

Legend:
Removed from v.506  
changed lines
  Added in v.507

  ViewVC Help
Powered by ViewVC 1.1.24