From 74d361a0fdfb1235bf59aad2630203c9fb21acda Mon Sep 17 00:00:00 2001 From: "igor%mir2.org" Date: Mon, 8 Apr 2002 21:52:10 +0000 Subject: [PATCH] In Interpreter.interpret move initialization of debug frame after the setup of nested functions so they are visible to debugger on debug frame creation git-svn-id: svn://10.0.0.236/trunk@118488 18797224-902f-48f8-a5cc-f745e15eee43 --- .../org/mozilla/javascript/Interpreter.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java b/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java index a0d7ac3718f..20b232abf4c 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java @@ -165,9 +165,7 @@ public class Interpreter extends LabelTable { VariableTable varTable = (VariableTable)tree.getProp(Node.VARS_PROP); // The default is not to generate debug information - boolean activationNeeded = cx.isGeneratingDebugChanged() && - cx.isGeneratingDebug(); - generateICodeFromTree(tree, varTable, activationNeeded, securityDomain); + generateICodeFromTree(tree, varTable, false, securityDomain); itsData.itsNestedFunctions = itsNestedFunctions; itsData.itsRegExpLiterals = regExpLiterals; if (Context.printICode) dumpICode(itsData); @@ -1498,10 +1496,11 @@ public class Interpreter extends LabelTable { }else if (!theData.itsUseDynamicScope) { scope = fnOrScript.getParentScope(); } + if (theData.itsCheckThis) { thisObj = ScriptRuntime.getThis(thisObj); } - + if (theData.itsNeedsActivation) { scope = ScriptRuntime.initVarObj(cx, scope, fnOrScript, thisObj, args); @@ -1512,18 +1511,18 @@ public class Interpreter extends LabelTable { theData.itsFromEvalCode); } - DebugFrame frame = null; - if (cx.debugger != null) { - frame = cx.debugger.enterFrame(cx, scope, thisObj, args, - (DebuggableScript)fnOrScript); - } - if (theData.itsNestedFunctions != null) { for (int i = 0; i < theData.itsNestedFunctions.length; i++) createFunctionObject(theData.itsNestedFunctions[i], scope, theData.itsFromEvalCode); } + DebugFrame frame = null; + if (cx.debugger != null) { + frame = cx.debugger.enterFrame(cx, scope, thisObj, args, + (DebuggableScript)fnOrScript); + } + Object result = undefined; byte[] iCode = theData.itsICode;