use of org.apache.sling.scripting.sightly.js.impl.use.DependencyResolver in project sling by apache.
the class JsEnvironment method buildBindings.
private Bindings buildBindings(Resource scriptResource, Bindings local, Bindings arguments, CommonJsModule commonJsModule) {
Bindings bindings = new SimpleBindings();
bindings.putAll(engineBindings);
DependencyResolver dependencyResolver = new DependencyResolver(scriptResource, this, local);
UseFunction useFunction = new UseFunction(dependencyResolver, arguments);
bindings.put(Variables.JS_USE, useFunction);
bindings.put(Variables.MODULE, commonJsModule);
bindings.put(Variables.EXPORTS, commonJsModule.getExports());
bindings.put(Variables.CONSOLE, new Console(LoggerFactory.getLogger(scriptResource.getName())));
bindings.putAll(local);
return bindings;
}
Aggregations