diff --git a/js/rhino/src/org/mozilla/javascript/Interpreter.java b/js/rhino/src/org/mozilla/javascript/Interpreter.java index 8c1196e82f05..75416b0b9a4d 100644 --- a/js/rhino/src/org/mozilla/javascript/Interpreter.java +++ b/js/rhino/src/org/mozilla/javascript/Interpreter.java @@ -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(); diff --git a/js/rhino/src/org/mozilla/javascript/InterpreterData.java b/js/rhino/src/org/mozilla/javascript/InterpreterData.java index f965a3acc947..8271242f980f 100644 --- a/js/rhino/src/org/mozilla/javascript/InterpreterData.java +++ b/js/rhino/src/org/mozilla/javascript/InterpreterData.java @@ -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; + } + } diff --git a/js/rhino/src/org/mozilla/javascript/debug/DebuggableScript.java b/js/rhino/src/org/mozilla/javascript/debug/DebuggableScript.java index 93487c06d2ae..104e5df0d034 100644 --- a/js/rhino/src/org/mozilla/javascript/debug/DebuggableScript.java +++ b/js/rhino/src/org/mozilla/javascript/debug/DebuggableScript.java @@ -83,4 +83,6 @@ public interface DebuggableScript public DebuggableScript getFunction(int index); + public DebuggableScript getParent(); + }