[INFER] Handle case in INCNAME on const vars which are morphed into GETGNAME by the emitter, bug 673731.

This commit is contained in:
Brian Hackett 2011-07-25 07:42:46 -07:00
parent 4a15c69088
commit 062072fa23
2 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,3 @@
// |jit-test| error: ReferenceError
const IS_TOKEN_ARRAY = [ printBugNumber && IS_TOKEN_ARRAY++ && this() ? this() : this() ];

View File

@ -6554,8 +6554,13 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
EMIT_UINT16_IMM_OP(op, atomIndex);
} else {
JS_ASSERT(JOF_OPTYPE(op) == JOF_ATOM);
if (!EmitNameIncDec(cx, pn2, op, cg))
return JS_FALSE;
if (js_CodeSpec[op].format & (JOF_INC | JOF_DEC)) {
if (!EmitNameIncDec(cx, pn2, op, cg))
return JS_FALSE;
} else {
if (!EmitAtomOp(cx, pn2, op, cg))
return JS_FALSE;
}
break;
}
if (pn2->isConst()) {