Method | Description | |
---|---|---|
Call ( |
||
Construct ( |
||
GetArity ( ) : int | ||
GetFunctionName ( ) : string | ||
GetLength ( ) : int | ||
Install ( Scriptable scope ) : void |
Binds this instance of require() into the specified scope under the property name "require". Binds this instance of require() into the specified scope under the property name "require". |
|
Require ( |
Creates a new instance of the require() function. Creates a new instance of the require() function. Upon constructing it, you will either want to install it in the global (or some other) scope using |
|
RequireMain ( |
Calling this method establishes a module as being the main module of the program to which this require() instance belongs. Calling this method establishes a module as being the main module of the program to which this require() instance belongs. The module will be loaded as if require()'d and its "module" property will be set as the "main" property of this require() instance. You have to call this method before the module has been loaded (that is, the call to this method must be the first to require the module and thus trigger its loading). Note that the main module will execute in its own scope and not in the global scope. Since all other modules see the global scope, executing the main module in the global scope would open it for tampering by other modules. |
Method | Description | |
---|---|---|
DefineReadOnlyProperty ( ScriptableObject obj, string name, object value ) : void | ||
ExecuteModuleScript ( |
||
ExecuteOptionalScript ( System.Script script, |
||
GetExportedModuleInterface ( |
||
GetModule ( |
public Call ( |
||
cx | ||
scope | Scriptable | |
thisObj | Scriptable | |
args | object | |
return | object |
public Construct ( |
||
cx | ||
scope | Scriptable | |
args | object | |
return | Scriptable |
public Install ( Scriptable scope ) : void | ||
scope | Scriptable | the scope where the require() function is to be installed. |
return | void |
public Require ( |
||
cx | the current context | |
nativeScope | Scriptable | /// a scope that provides the standard native JavaScript /// objects. /// |
moduleScriptProvider | ModuleScriptProvider | a provider for module scripts |
preExec | System.Script | /// an optional script that is executed in every module's /// scope before its module script is run. /// |
postExec | System.Script | /// an optional script that is executed in every module's /// scope after its module script is run. /// |
sandboxed | bool | /// if set to true, the require function will be sandboxed. /// This means that it doesn't have the "paths" property, and also that the /// modules it loads don't export the "module.uri" property. /// |
return | System |
public RequireMain ( |
||
cx | the current context | |
mainModuleId | string | the ID of the main module |
return | Scriptable |