| 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; |