Fixed bug #7703, typeof<var> wasn't referencing activation frame vars

correctly.
This commit is contained in:
rogerl%netscape.com 1999-06-07 22:29:41 +00:00
parent f4713568a3
commit 4b314af77e
2 changed files with 6 additions and 2 deletions

View File

@ -592,7 +592,9 @@ public class Interpreter extends LabelTable {
case TokenStream.TYPEOF : {
String name = node.getString();
int index = -1;
if (itsInFunctionFlag)
// use typeofname if an activation frame exists
// since the vars all exist there instead of in jregs
if (itsInFunctionFlag && !itsData.itsNeedsActivation)
index = itsData.itsVariableTable.getOrdinal(name);
if (index == -1) {
iCodeTop = addByte((byte) TokenStream.TYPEOFNAME, iCodeTop);

View File

@ -592,7 +592,9 @@ public class Interpreter extends LabelTable {
case TokenStream.TYPEOF : {
String name = node.getString();
int index = -1;
if (itsInFunctionFlag)
// use typeofname if an activation frame exists
// since the vars all exist there instead of in jregs
if (itsInFunctionFlag && !itsData.itsNeedsActivation)
index = itsData.itsVariableTable.getOrdinal(name);
if (index == -1) {
iCodeTop = addByte((byte) TokenStream.TYPEOFNAME, iCodeTop);