MCPcopy Create free account
hub / github.com/FongMi/TV / createObj

Method createObj

quickjs/src/main/java/com/fongmi/quickjs/crawler/Spider.java:188–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186 }
187
188 private void createObj() {
189 String spider = "__JS_SPIDER__";
190 String global = "globalThis." + spider;
191 String content = Module.get().fetch(api);
192 cat = content.contains("__jsEvalReturn");
193 ctx.evaluateModule(content.replace(spider, global), api);
194 ctx.evaluateModule(String.format(Asset.read("js/lib/spider.js"), api));
195 jsObject = (JSObject) ctx.getProperty(ctx.getGlobalObject(), spider);
196 }
197
198 private Object getExt(String ext) {
199 if (!cat) return Json.isObj(ext) ? ctx.parse(ext) : ext;

Callers 1

initializeJSMethod · 0.95

Calls 6

getMethod · 0.95
readMethod · 0.95
fetchMethod · 0.65
containsMethod · 0.45
replaceMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected