зеркало из https://github.com/mozilla/gecko-dev.git
Fix for #366550 � increment and decrement operators don't work for global vars with dynamic scopes (patch by Hannes Wallnoefer)
This commit is contained in:
Родитель
29fbd4596b
Коммит
84f52576a7
|
@ -29,6 +29,7 @@
|
|||
* Terry Lucas
|
||||
* Roger Lawrence
|
||||
* Milen Nankov
|
||||
* Hannes Wallnoefer
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which
|
||||
|
@ -3166,7 +3167,7 @@ switch (op) {
|
|||
continue Loop;
|
||||
case Icode_NAME_INC_DEC :
|
||||
stack[++stackTop] = ScriptRuntime.nameIncrDecr(frame.scope, stringReg,
|
||||
iCode[frame.pc]);
|
||||
cx, iCode[frame.pc]);
|
||||
++frame.pc;
|
||||
continue Loop;
|
||||
case Icode_SETVAR1:
|
||||
|
@ -3217,7 +3218,7 @@ switch (op) {
|
|||
} else {
|
||||
String varName = frame.idata.argNames[indexReg];
|
||||
stack[stackTop] = ScriptRuntime.nameIncrDecr(frame.scope, varName,
|
||||
incrDecrMask);
|
||||
cx, incrDecrMask);
|
||||
}
|
||||
++frame.pc;
|
||||
continue Loop;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
* Igor Bukanov
|
||||
* Roger Lawrence
|
||||
* Andi Vajda
|
||||
* Hannes Wallnoefer
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which
|
||||
|
@ -3196,10 +3197,12 @@ Else pass the JS object in the aReg and 0.0 in the dReg.
|
|||
case Token.NAME:
|
||||
cfw.addALoad(variableObjectLocal);
|
||||
cfw.addPush(child.getString()); // push name
|
||||
cfw.addALoad(contextLocal);
|
||||
cfw.addPush(incrDecrMask);
|
||||
addScriptRuntimeInvoke("nameIncrDecr",
|
||||
"(Lorg/mozilla/javascript/Scriptable;"
|
||||
+"Ljava/lang/String;"
|
||||
+"Lorg/mozilla/javascript/Context;"
|
||||
+"I)Ljava/lang/Object;");
|
||||
break;
|
||||
case Token.GETPROP: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче