Package org.mozilla.javascript.commonjs.module

Examples of org.mozilla.javascript.commonjs.module.Require


    }
   
    private Require getSandboxedRequire(Context cx, Scriptable scope, boolean sandboxed)
            throws URISyntaxException
    {
        return new Require(cx, cx.initStandardObjects(),
                new StrongCachingModuleScriptProvider(
                        new UrlModuleSourceProvider(Collections.singleton(
                                getDirectory()), null)), null, null, true);
    }
View Full Code Here


            }
        }
        rb.setModuleScriptProvider(
                new SoftCachingModuleScriptProvider(
                        new UrlModuleSourceProvider(uris, null)));
        Require require = rb.createRequire(cx, this);
        require.install(this);
        return require;
    }
View Full Code Here

            }
        }
        rb.setModuleScriptProvider(
                new SoftCachingModuleScriptProvider(
                        new UrlModuleSourceProvider(uris, null)));
        Require require = rb.createRequire(context, globalScope);
        require.install(globalScope);
    }
View Full Code Here

      // This is pretty ugly - we have to set some thread locals so we can get a reference to the scope and
      // classloader in the load() method - this is because Rhino insists load() must be static
      scopeThreadLocal.set(scope);
      clThreadLocal.set(cl);

      Require require = installRequire(cl, cx, scope);

      Scriptable script = require.requireMain(cx, scriptName);
      try {
        stopFunction = (Function) script.get("vertxStop", scope);
      } catch (ClassCastException e) {
        // Get CCE if no such function
        stopFunction = null;
View Full Code Here

     * Create a new require function using the shared global.
     * @return
     */
    @SuppressWarnings("unused")
    private Require createRequire() {
        Require require = null;
        RequireBuilder builder = getRequireBuilder();
        Context cx = CommonJSEngine.enterContext();
        try {
            require = builder.createRequire(cx, global);
        } finally {
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.commonjs.module.Require

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.