Adding getParent() to omg.debug.DebuggableScript to allow to browse whole script function tree from any function.

This commit is contained in:
igor%mir2.org 2003-10-01 15:03:06 +00:00
parent ad34599811
commit 2593ae88cb
3 changed files with 11 additions and 0 deletions

View File

@ -255,6 +255,7 @@ public class Interpreter
jsi.scriptOrFn = def;
jsi.itsData = new InterpreterData(itsData.securityDomain,
itsData.languageVersion);
jsi.itsData.parentData = itsData;
jsi.itsData.itsSourceFile = itsData.itsSourceFile;
jsi.itsData.encodedSource = itsData.encodedSource;
jsi.itsData.itsCheckThis = def.getCheckThis();

View File

@ -100,6 +100,8 @@ final class InterpreterData implements Serializable, DebuggableScript
boolean topLevel;
InterpreterData parentData;
public boolean isTopLevel()
{
return topLevel;
@ -139,4 +141,10 @@ final class InterpreterData implements Serializable, DebuggableScript
{
return itsNestedFunctions[index];
}
public DebuggableScript getParent()
{
return parentData;
}
}

View File

@ -83,4 +83,6 @@ public interface DebuggableScript
public DebuggableScript getFunction(int index);
public DebuggableScript getParent();
}