dojox/secure/capability (version 1.10)

See the dojox/secure/capability reference documentation for more information.

Property Summary

Method Summary

  • validate(script,safeLibraries,safeGlobals) pass in the text of a script.

Properties

keywords

Methods

validate(script,safeLibraries,safeGlobals)

pass in the text of a script. If it passes and it can be eval'ed, it should be safe. Note that this does not do full syntax checking, it relies on eval to reject invalid scripts. There are also known false rejections:

  • Nesting vars inside blocks will not declare the variable for the outer block
  • Named functions are not treated as declaration so they are generally not allowed unless the name is declared with a var.
  • Var declaration that involve multiple comma delimited variable assignments are not accepted
Parameter Type Description
script string

the script to execute

safeLibraries Array

The safe libraries that can be called (the functions can not be access/modified by the untrusted code, only called)

safeGlobals Object

These globals can be freely interacted with by the untrusted code

Error in the documentation? Can’t find what you are looking for? Let us know!