@Override public Scriptable construct(Context cx, Scriptable scope, Object[] args) { throw ScriptRuntime.throwError(cx, scope, "require() can not be invoked as a constructor"); }
public Scriptable construct(Context cx, Scriptable scope, Object[] args) { throw ScriptRuntime.throwError(cx, scope, "require() can not be invoked as a constructor"); }
public Scriptable construct(Context cx, Scriptable scope, Object[] args) { throw ScriptRuntime.throwError(cx, scope, "require() can not be invoked as a constructor"); }
public Scriptable construct(Context cx, Scriptable scope, Object[] args) { throw ScriptRuntime.throwError(cx, scope, "require() can not be invoked as a constructor"); }
throw ScriptRuntime.throwError(cx, scope, "require() needs one argument"); if (id.startsWith("./") || id.startsWith("../")) { if (!(thisObj instanceof ModuleScope)) { throw ScriptRuntime.throwError(cx, scope, "Can't resolve relative module ID \"" + id + "\" when require() is used outside of a module"); throw ScriptRuntime.throwError(cx, scope, "Module \"" + id + "\" is not contained in sandbox."); } else {
private ModuleScript getModule(Context cx, String id, URI uri, URI base) { try { final ModuleScript moduleScript = moduleScriptProvider.getModuleScript(cx, id, uri, base, paths); if (moduleScript == null) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" not found."); } return moduleScript; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw Context.throwAsScriptRuntimeEx(e); } }
throw ScriptRuntime.throwError(cx, scope, "require() needs one argument"); if (id.startsWith("./") || id.startsWith("../")) { if (!(thisObj instanceof ModuleScope)) { throw ScriptRuntime.throwError(cx, scope, "Can't resolve relative module ID \"" + id + "\" when require() is used outside of a module"); throw ScriptRuntime.throwError(cx, scope, "Module \"" + id + "\" is not contained in sandbox."); } else {
private ModuleScript getModule(Context cx, String id, URI uri, URI base) { try { final ModuleScript moduleScript = moduleScriptProvider.getModuleScript(cx, id, uri, base, paths); if (moduleScript == null) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" not found."); } return moduleScript; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw Context.throwAsScriptRuntimeEx(e); } }
throw ScriptRuntime.throwError(cx, scope, "require() needs one argument"); if (id.startsWith("./") || id.startsWith("../")) { if (!(thisObj instanceof ModuleScope)) { throw ScriptRuntime.throwError(cx, scope, "Can't resolve relative module ID \"" + id + "\" when require() is used outside of a module"); throw ScriptRuntime.throwError(cx, scope, "Module \"" + id + "\" is not contained in sandbox."); } else {
throw ScriptRuntime.throwError(cx, scope, "require() needs one argument"); if (id.startsWith("./") || id.startsWith("../")) { if (!(thisObj instanceof ModuleScope)) { throw ScriptRuntime.throwError(cx, scope, "Can't resolve relative module ID \"" + id + "\" when require() is used outside of a module"); throw ScriptRuntime.throwError(cx, scope, "Module \"" + id + "\" is not contained in sandbox."); } else {
private ModuleScript getModule(Context cx, String id, URI uri, URI base) { try { final ModuleScript moduleScript = moduleScriptProvider.getModuleScript(cx, id, uri, base, paths); if (moduleScript == null) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" not found."); } return moduleScript; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw Context.throwAsScriptRuntimeEx(e); } }
private ModuleScript getModule(Context cx, String id, URI uri, URI base) { try { final ModuleScript moduleScript = moduleScriptProvider.getModuleScript(cx, id, uri, base, paths); if (moduleScript == null) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" not found."); } return moduleScript; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw Context.throwAsScriptRuntimeEx(e); } }
File file = new File(mainModuleId); if (!file.isFile()) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + mainModuleId + "\" not found.");
File file = new File(mainModuleId); if (!file.isFile()) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + mainModuleId + "\" not found.");
File file = new File(mainModuleId); if (!file.isFile()) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + mainModuleId + "\" not found.");
File file = new File(mainModuleId); if (!file.isFile()) { throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + mainModuleId + "\" not found.");
throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" is not contained in sandbox.");
throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" is not contained in sandbox.");
throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" is not contained in sandbox.");
throw ScriptRuntime.throwError(cx, nativeScope, "Module \"" + id + "\" is not contained in sandbox.");