Engine Configuration Options

A number of other configuration options are available from the Engine to fine-tune behavior and safeguards.

Language Features

MethodDescription
set_allow_if_expressionallows/disallows if-expressions
set_allow_switch_expressionallows/disallows switch expressions
set_allow_statement_expressionallows/disallows statement expressions
set_allow_anonymous_fn
(not available under no_function)
allows/disallows anonymous functions
set_allow_loopingallows/disallows looping (i.e. while, loop, do and for statements)
disable_symboldisables a certain keyword or operator (see disable keywords and operators)

Compiler Behavior

MethodDescription
set_optimization_level
(not available under no_optimize)
sets the amount of script optimizations performed (see script optimization)
set_strict_variablesenables/disables Strict Variables mode

Safety Limits

MethodNot available underDescription
set_max_expr_depthsuncheckedsets the maximum nesting levels of an expression/statement (see maximum statement depth)
set_max_call_levelsuncheckedsets the maximum number of function call levels (default 50) to avoid infinite recursion (see maximum call stack depth)
set_max_operationsuncheckedsets the maximum number of operations that a script is allowed to consume (see maximum number of operations)
set_max_modulesuncheckedsets the maximum number of modules that a script is allowed to load (see maximum number of modules)
set_max_string_sizeuncheckedsets the maximum length (in UTF-8 bytes) for strings (see maximum length of strings)
set_max_array_sizeunchecked, no_indexsets the maximum size for arrays (see maximum size of arrays)
set_max_map_sizeunchecked, no_objectsets the maximum number of properties for object maps (see maximum size of object maps)