зеркало из https://github.com/mozilla/gecko-dev.git
Bug 730810 - Don't assert doing a compound assignment to a const. r=luke
This commit is contained in:
Родитель
4382ca0bd3
Коммит
014773859c
|
@ -3700,7 +3700,7 @@ EmitAssignment(JSContext *cx, BytecodeEmitter *bce, ParseNode *lhs, JSOp op, Par
|
|||
if (lhs->isOp(JSOP_CALLEE)) {
|
||||
if (Emit1(cx, bce, JSOP_CALLEE) < 0)
|
||||
return false;
|
||||
} else if (lhs->isOp(JSOP_NAME)) {
|
||||
} else if (lhs->isOp(JSOP_NAME) || lhs->isOp(JSOP_GETGNAME)) {
|
||||
if (!EmitIndex32(cx, lhs->getOp(), atomIndex, bce))
|
||||
return false;
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
// Any copyright is dedicated to the Public Domain.
|
||||
// http://creativecommons.org/licenses/publicdomain/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 730810;
|
||||
var summary = "Don't assert on compound assignment to a const";
|
||||
|
||||
print(BUGNUMBER + ": " + summary);
|
||||
|
||||
/**************
|
||||
* BEGIN TEST *
|
||||
**************/
|
||||
|
||||
const x = 3;
|
||||
x += 2;
|
||||
assertEq(x, 2);
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
||||
|
||||
print("Tests complete!");
|
|
@ -61,3 +61,4 @@ script regress-691746.js
|
|||
script regress-697515.js
|
||||
script correct-this-for-nonnatives-on-array-proto-chain.js
|
||||
script toSource-0.js
|
||||
script compound-assign-const.js
|
||||
|
|
Загрузка…
Ссылка в новой задаче