Fix stack id "leak" on replaceStack
This commit is contained in:
@@ -688,6 +688,7 @@ JavaScriptCompiler.prototype = {
|
|||||||
var prefix = '',
|
var prefix = '',
|
||||||
inline = this.isInline(),
|
inline = this.isInline(),
|
||||||
stack,
|
stack,
|
||||||
|
createdStack,
|
||||||
usedLiteral;
|
usedLiteral;
|
||||||
|
|
||||||
// If we are currently inline then we want to merge the inline statement into the
|
// If we are currently inline then we want to merge the inline statement into the
|
||||||
@@ -701,7 +702,8 @@ JavaScriptCompiler.prototype = {
|
|||||||
usedLiteral = true;
|
usedLiteral = true;
|
||||||
} else {
|
} else {
|
||||||
// Get or create the current stack name for use by the inline
|
// Get or create the current stack name for use by the inline
|
||||||
var name = this.stackSlot ? this.topStackName() : this.incrStack();
|
createdStack = !this.stackSlot;
|
||||||
|
var name = !createdStack ? this.topStackName() : this.incrStack();
|
||||||
|
|
||||||
prefix = '(' + this.push(name) + ' = ' + top + '),';
|
prefix = '(' + this.push(name) + ' = ' + top + '),';
|
||||||
stack = this.topStack();
|
stack = this.topStack();
|
||||||
@@ -716,6 +718,9 @@ JavaScriptCompiler.prototype = {
|
|||||||
if (!usedLiteral) {
|
if (!usedLiteral) {
|
||||||
this.popStack();
|
this.popStack();
|
||||||
}
|
}
|
||||||
|
if (createdStack) {
|
||||||
|
this.stackSlot--;
|
||||||
|
}
|
||||||
this.push('(' + prefix + item + ')');
|
this.push('(' + prefix + item + ')');
|
||||||
} else {
|
} else {
|
||||||
// Prevent modification of the context depth variable. Through replaceStack
|
// Prevent modification of the context depth variable. Through replaceStack
|
||||||
|
|||||||
Reference in New Issue
Block a user