--- trunk/instrument-js.c 2007/11/27 23:06:50 83 +++ trunk/instrument-js.c 2007/12/01 01:44:21 84 @@ -385,13 +385,20 @@ the dot syntax. */ instrument_expression(node->pn_expr, f); - /* - fputc('.', f); - print_string_atom(node->pn_atom, f); - */ - fputc('[', f); - print_quoted_string_atom(node->pn_atom, f); - fputc(']', f); + assert(ATOM_IS_STRING(node->pn_atom)); + { + JSString * s = ATOM_TO_STRING(node->pn_atom); + /* XXX - semantics changed in 1.7 */ + if (! ATOM_KEYWORD(node->pn_atom) && js_IsIdentifier(s)) { + fputc('.', f); + print_string_atom(node->pn_atom, f); + } + else { + fputc('[', f); + print_quoted_string_atom(node->pn_atom, f); + fputc(']', f); + } + } break; case TOK_LB: instrument_expression(node->pn_left, f);