246911 - misbehave of switch() statement when variable is used as a label - patch by shaver, r=brendan

git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@157925 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ben%bengoodger.com
2004-06-15 23:03:44 +00:00
parent a6b472bc90
commit fa58aee0c7

View File

@@ -3415,7 +3415,8 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
if (op == JSOP_SETNAME)
EMIT_ATOM_INDEX_OP(JSOP_BINDNAME, atomIndex);
pn3 = pn2->pn_expr;
if (!js_DefineCompileTimeConstant(cx, cg, pn2->pn_atom,
if (pn->pn_op == JSOP_DEFCONST &&
!js_DefineCompileTimeConstant(cx, cg, pn2->pn_atom,
pn3)) {
return JS_FALSE;
}