mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 730810 - Don't assert doing a compound assignment to a const. r=luke
This commit is contained in:
parent
0a850b3ea8
commit
7e88cd00ca
@ -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 {
|
||||
|
23
js/src/tests/js1_8_5/extensions/compound-assign-const.js
Normal file
23
js/src/tests/js1_8_5/extensions/compound-assign-const.js
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user