Subj : Re: Too permissive semicolon insertion? To : Igor Bukanov From : Brendan Eich Date : Sun Aug 22 2004 03:16 pm This is a multi-part message in MIME format. --------------030403080601090405050607 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Igor Bukanov wrote: > There is another case of this anomaly: > > 1 + > 2 3; > > Regards, Igor Thanks -- this one's more recent than the other bug, and notice that it bites only constant + expressions. Fixed on the trunk, patch attached. /be --------------030403080601090405050607 Content-Type: text/plain; name="jsparse.patch2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="jsparse.patch2" Index: jsparse.c =================================================================== RCS file: /cvsroot/mozilla/js/src/jsparse.c,v retrieving revision 3.106 diff -p -u -8 -r3.106 jsparse.c --- jsparse.c 22 Aug 2004 18:51:07 -0000 3.106 +++ jsparse.c 22 Aug 2004 21:20:03 -0000 @@ -281,16 +281,17 @@ NewBinary(JSContext *cx, JSTokenType tt, * operations with more than one leading non-string operand in a PN_LIST * generated for expressions such as 1 + 2 + "pt" (which should evaluate * to "3pt", not "12pt"). */ if (tt == TOK_PLUS && left->pn_type == TOK_NUMBER && right->pn_type == TOK_NUMBER) { left->pn_dval += right->pn_dval; + left->pn_pos.end = right->pn_pos.end; RecycleTree(right, tc); return left; } pn = NewOrRecycledNode(cx, tc); if (!pn) return NULL; pn->pn_type = tt; --------------030403080601090405050607-- .