public IRMethod getNearestMethod() { IRScope current = this; while (current != null && !(current instanceof IRMethod)) { current = current.getLexicalParent(); } return (IRMethod) current; }
public IRMethod getNearestMethod() { IRScope current = this; while (current != null && !(current instanceof IRMethod)) { current = current.getLexicalParent(); } return (IRMethod) current; }
public IRMethod getNearestMethod() { IRScope current = this; while (current != null && !(current instanceof IRMethod)) { current = current.getLexicalParent(); } return (IRMethod) current; }
public IRScope getNearestTopLocalVariableScope() { IRScope current = this; while (current != null && !current.isTopLocalVariableScope()) { current = current.getLexicalParent(); } return current; }
public boolean parentMaybeUsingRefinements() { for (IRScope s = this; s != null; s = s.getLexicalParent()) { if (s.getFlags().contains(MAYBE_USING_REFINEMENTS)) return true; // Evals cannot see outer scope 'using' if (s instanceof IREvalScript) return false; } return false; }
public IRScope getNearestFlipVariableScope() { IRScope current = this; while (current != null && !current.isFlipScope()) { current = current.getLexicalParent(); } return current; }
public IRScope getNearestTopLocalVariableScope() { IRScope current = this; while (current != null && !current.isTopLocalVariableScope()) { current = current.getLexicalParent(); } return current; }
public boolean isNestedInClosure(IRClosure closure) { for (IRScope s = this; s != null && !s.isTopLocalVariableScope(); s = s.getLexicalParent()) { if (s == closure) return true; } return false; }
/** * Returns the top level scope */ public IRScope getRootLexicalScope() { IRScope current = this; for (; current != null && !current.isScriptScope(); current = current.getLexicalParent()) {} return current; }
/** * Returns the top level scope */ public IRScope getRootLexicalScope() { IRScope current = this; for (; current != null && !current.isScriptScope(); current = current.getLexicalParent()) {} return current; }
/** * Returns the top level scope */ public IRScope getTopLevelScope() { IRScope current = this; for (; current != null && !current.isScriptScope(); current = current.getLexicalParent()) {} return current; }
public IRScope getNearestTopLocalVariableScope() { IRScope current = this; while (current != null && !current.isTopLocalVariableScope()) { current = current.getLexicalParent(); } return current; }
public IRScope getNearestFlipVariableScope() { IRScope current = this; while (current != null && !current.isFlipScope()) { current = current.getLexicalParent(); } return current; }
public boolean isNestedInClosure(IRClosure closure) { for (IRScope s = this; s != null && !s.isTopLocalVariableScope(); s = s.getLexicalParent()) { if (s == closure) return true; } return false; }
public IRScope getNearestFlipVariableScope() { IRScope current = this; while (current != null && !current.isFlipScope()) { current = current.getLexicalParent(); } return current; }
public boolean isNestedInClosure(IRClosure closure) { for (IRScope s = this; s != null && !s.isTopLocalVariableScope(); s = s.getLexicalParent()) { if (s == closure) return true; } return false; }
public IRScope getNearestFlipVariableScope() { IRScope current = this; while (current != null && !current.isFlipScope()) { current = current.getLexicalParent(); } return current; }
public boolean isNestedInClosure(IRClosure closure) { for (IRScope s = this; s != null && !s.isTopLocalVariableScope(); s = s.getLexicalParent()) { if (s == closure) return true; } return false; }
private String getVarNameFromScopeTree(IRScope scope, int depth, int offset) { if (depth == 0) { return scope.getStaticScope().getVariables()[offset]; } return getVarNameFromScopeTree(scope.getLexicalParent(), depth - 1, offset); }
private String getVarNameFromScopeTree(IRScope scope, int depth, int offset) { if (depth == 0) { return scope.getStaticScope().getVariables()[offset]; } return getVarNameFromScopeTree(scope.getLexicalParent(), depth - 1, offset); }