PointerAnalysis<InstanceKey> pointerAnalysis = builder.getPointerAnalysis(); JavaScriptLoader jsLoader = (JavaScriptLoader) builder.getClassHierarchy().getLoader(JavaScriptTypes.jsLoader);
/** * get the CGNode representing the lexical parent of {@link #creator} with * name definer * */ public Iterator<CGNode> getFunargNodes(Pair<String, String> name) { Collection<CGNode> constructorCallers = getConstructorCallers(this, name); assert constructorCallers != null && !constructorCallers.isEmpty() : "no callers for constructor"; Iterator<CGNode> result = EmptyIterator.instance(); for (CGNode callerOfConstructor : constructorCallers) { if (callerOfConstructor.getMethod().getReference().getDeclaringClass().getName().toString().equals(name.snd)) { result = new CompoundIterator<>(result, new NonNullSingletonIterator<>(callerOfConstructor)); } else { PointerKey funcKey = builder.getPointerKeyForLocal(callerOfConstructor, 1); for (InstanceKey funcPtr : builder.getPointerAnalysis().getPointsToSet(funcKey)) { if (funcPtr instanceof ScopeMappingInstanceKey) { result = new CompoundIterator<>(result, ((ScopeMappingInstanceKey) funcPtr).getFunargNodes(name)); } } } } return result; }
/** * get the CGNode representing the lexical parent of {@link #creator} with * name definer * */ public Iterator<CGNode> getFunargNodes(Pair<String, String> name) { Collection<CGNode> constructorCallers = getConstructorCallers(this, name); assert constructorCallers != null && !constructorCallers.isEmpty() : "no callers for constructor"; Iterator<CGNode> result = EmptyIterator.instance(); for (CGNode callerOfConstructor : constructorCallers) { if (callerOfConstructor.getMethod().getReference().getDeclaringClass().getName().toString().equals(name.snd)) { result = new CompoundIterator<>(result, new NonNullSingletonIterator<>(callerOfConstructor)); } else { PointerKey funcKey = builder.getPointerKeyForLocal(callerOfConstructor, 1); for (InstanceKey funcPtr : builder.getPointerAnalysis().getPointsToSet(funcKey)) { if (funcPtr instanceof ScopeMappingInstanceKey) { result = new CompoundIterator<>(result, ((ScopeMappingInstanceKey) funcPtr).getFunargNodes(name)); } } } } return result; }