Constructor
new AvenxSandbox()
Initializes the AvenxSandbox instance.
- Source:
Classes
Members
bridges :object
Type:
- object
- Source:
components :Map:.<string:, function()>
Type:
- Source:
Methods
mount(compClass, propsopt, containeropt) → {object}
Mounts a component in isolation.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
compClass |
function | |||
props |
object |
<optional> |
||
container |
Element |
<optional> |
null |
- Source:
Returns:
Sandbox mount helper instance.
- Type
- object
register(name, compClass) → {AvenxSandbox}
Registers a component class with the sandbox.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | |
compClass |
function |
- Source:
Returns:
- Type
- AvenxSandbox
registerBridge(name, bridgeInstance) → {AvenxSandbox}
Registers a bridge with the sandbox.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | |
bridgeInstance |
object |
- Source:
Returns:
- Type
- AvenxSandbox
setRoute(route) → {AvenxSandbox}
Mocks the router state.
Parameters:
| Name | Type | Description |
|---|---|---|
route |
object |
- Source:
Returns:
- Type
- AvenxSandbox
(async) waitForUpdate() → {Promise:.<void:>}
Waits for any pending scheduled updates to complete.
- Source:
Returns:
(static) createProxy(scope, thisArg, excludeParamsopt) → {Proxy}
Creates a sandboxed Proxy context representing the combined scope and thisArg.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
scope |
object | The scope variables. |
||
thisArg |
object | The active 'this' context. |
||
excludeParams |
boolean |
<optional> |
false | If true, excludes special event params from the has trap. |
- Source:
Returns:
The sandboxed Proxy object.
- Type
- Proxy
(static) validateSource(source)
Statically validates an expression or statement string to ensure it does not contain forbidden property names.
Parameters:
| Name | Type | Description |
|---|---|---|
source |
string | The source code to check. |
- Source: