ScriptBehavior(script, scope)

A behavior that allows the execution of scripts stored in a string.

WARNING: Scripts are run inside of a rudimentary sandbox. The sandbox is NOT secure. Care should be taken to avoid running scripts from untrusted sources.

For full details on how to use this class, see the Behavior API tutorial.


# new ScriptBehavior(script, scope)

Create a new ScriptBehavior.

Name Type Description
script String

the script.

scope Object

an object containing variables to include in the script's scope.

View Source behaviors/script-behavior.js, line 14