public ResourceJarFileModule(URL resourceURL) { super(new SourceURLModule(resourceURL)); this.resourceURL = resourceURL; }
@Override public Reader getInputReader() { return new InputStreamReader(getInputStream()); }
public ResourceJarFileModule(URL resourceURL) { super(new SourceURLModule(resourceURL)); this.resourceURL = resourceURL; }
@Override public Reader getInputReader() { return new InputStreamReader(getInputStream()); }
/** * @return The set of class names that where defined in the CHA as a result * loading process. */ public static Set<String> loadAdditionalFile(IClassHierarchy cha, JavaScriptLoader cl, URL url) throws IOException { return loadAdditionalFile(cha, cl, new SourceURLModule(url)); }
/** * @return The set of class names that where defined in the CHA as a result * loading process. */ public static Set<String> loadAdditionalFile(IClassHierarchy cha, JavaScriptLoader cl, URL url) throws IOException { return loadAdditionalFile(cha, cl, new SourceURLModule(url)); }
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(URL url) throws ClassHierarchyException { Set<? extends SourceModule> scripts = null; if(url.getPath().endsWith(".js")) { scripts = Collections.singleton(new SourceURLModule(url)); } else { JavaScriptLoader.addBootstrapFile(WebUtil.preamble); try { scripts = WebUtil.extractScriptFromHTML(url, DefaultSourceExtractor.factory).fst; } catch (Error e) { e.printStackTrace(); assert false : e.warning; } } Map<IMethod, CorrelationSummary> summaries = findCorrelatedAccesses(scripts); return summaries; }
public Map<IMethod, CorrelationSummary> findCorrelatedAccesses(URL url) throws ClassHierarchyException { Set<? extends SourceModule> scripts = null; if(url.getPath().endsWith(".js")) { scripts = Collections.singleton(new SourceURLModule(url)); } else { JavaScriptLoader.addBootstrapFile(WebUtil.preamble); try { scripts = WebUtil.extractScriptFromHTML(url, DefaultSourceExtractor.factory).fst; } catch (Error e) { e.printStackTrace(); assert false : e.warning; } } Map<IMethod, CorrelationSummary> summaries = findCorrelatedAccesses(scripts); return summaries; }
public static Module[] makeSourceModules(String dir, String name, ClassLoader loader) throws IOException { URL script = getURLforFile(dir, name, loader); Module[] modules = new Module[] { (script.openConnection() instanceof JarURLConnection)? new SourceURLModule(script): makeSourceModule(script, dir, name), getPrologueFile("prologue.js") }; return modules; }
public Pair<JSCallGraph, PointerAnalysis<ObjectVertex>> buildScriptCG(URL url, BuilderType builderType, IProgressMonitor monitor, boolean supportFullPointerAnalysis) throws WalaException, CancelException { JavaScriptLoaderFactory loaders = new JavaScriptLoaderFactory(translatorFactory); Module[] scripts = new Module[]{ new SourceURLModule(url), JSCallGraphUtil.getPrologueFile("prologue.js") }; return buildCG(loaders, scripts, builderType, monitor, supportFullPointerAnalysis); }
public static SourceModule[] makeHtmlScope(URL url, JavaScriptLoaderFactory loaders, Supplier<JSSourceExtractor> fExtractor) { Set<Module> scripts = HashSetFactory.make(); JavaScriptLoader.addBootstrapFile(WebUtil.preamble); scripts.add(getPrologueFile("prologue.js")); scripts.add(getPrologueFile("preamble.js")); try { scripts.addAll(WebUtil.extractScriptFromHTML(url, fExtractor).fst); } catch (Error e) { SourceModule dummy = new SourceURLModule(url); scripts.add(dummy); ((CAstAbstractLoader)loaders.getTheLoader()).addMessages(dummy, e.warning); } SourceModule[] scriptsArray = scripts.toArray(new SourceModule[0]); return scriptsArray; }
FileUtil.writeFile(tmp, in); final Map<IMethod, CorrelationSummary> summaries = makeCorrelationFinder().findCorrelatedAccesses(Collections.singleton(new SourceURLModule(tmp.toURI().toURL()))); CAstImpl ast = new CAstImpl(); CAstEntity inEntity = parseJS(tmp, ast);
scope.addToScope( scope.getJavaScriptLoader(), new SourceURLModule(script));