Name ==== Scope.Provider - cross-platform JavaScript scope provider SYNOPSIS ======== var provider = new Scope.Provider.IFrame() provider.setup(function () { if (provider.scope.SOME_GLOBAL == 'some_value') { ... } provider.runCode(text, callback) ... provider.runScript(url, callback) ... provider.cleanup() }) DESCRIPTION =========== `Scope.Provider` distribution implements cross-platform (browser/NodeJS) creation of the new JavaScript scope. By itself, `Scope.Provider` is an abstract class, all concrete work is delegated to its subclasses: [Scope.Provider.IFrame](Provider/IFrame.html) [Scope.Provider.Window](Provider/Window.html) [Scope.Provider.NodeJS](Provider/NodeJS.html) ATTRIBUTES ========== ### scope > `Object scope` > A newly created scope (usually `window` in browsers and `global` in NodeJS) METHODS ======= ### setup > `setup(Function callback)` > Set up a new scope. Scope will be ready in the provided callback. Callback will receive an instance of `Scope.Provider` as the 1st argument ### runCode > `runCode(String text, Function callback)` > Run a code, presented with `text` argument, in the previously created scope. Code will be ran by the time of the `callback` function called. Callback won't receive any arguments. ### runScript > `runScript(String url, Function callback)` > Run a code, in script on the `url`, in the previously created scope. Code will be ran by the time of the `callback` function called. Callback won't receive any arguments. ### cleanup > `cleanup()` > Releases any resources, used during scope creation. GETTING HELP ============ This extension is supported via github issues tracker: For general Joose questions you can also visit [#joose](http://webchat.freenode.net/?randomnick=1&channels=joose&prompt=1) on irc.freenode.org or the forum at: SEE ALSO ======== Web page of this module: General documentation for Joose: BUGS ==== All complex software has bugs lurking in it, and this module is no exception. Please report any bugs through the web interface at AUTHORS ======= Nickolay Platonov COPYRIGHT AND LICENSE ===================== This software is Copyright (c) 2010 by Nickolay Platonov . This is free software, licensed under: The GNU Lesser General Public License, Version 3, June 2007