- Notifications
You must be signed in to change notification settings - Fork 49
Jint
JavaScriptEngineSwitcher.Jint contains a JintJsEngine adapter (wrapper for the Jint version 4.15.3).
You can specify a settings of JS engine during its registration:
engineSwitcher.EngineFactories.AddJint(newJintSettings{StrictMode=true});If you manually create an instance of JS engine, then you can pass settings via the constructor:
IJsEngineengine=newJintJsEngine(newJintSettings{StrictMode=true});Consider in detail properties of the JintSettings class:
| Property name | Data type | Default value | Description |
|---|---|---|---|
AllowReflection | Boolean | false | Flag for whether to allow the usage of reflection API in the script code. This affects |
CompileRegex | Nullable<Boolean> | false | Value that determines whether to create compiled instances of regular expressions during script pre-compilation:
|
DebuggerBreakCallback | DebugEventHandler delegate | null | Debugger break callback. |
DebuggerExceptionThrownCallback | ExceptionThrownEventHandler delegate | null | Debugger exception thrown callback. |
DebuggerStatementHandlingMode | JsDebuggerStatementHandlingMode enumeration | Ignore | Handling mode for script debugger statements. Can take the following values:
|
DebuggerStepCallback | DebugEventHandler | null | Debugger step callback. |
DisableEval | Boolean | false | Flag for whether to disable calls of eval function with custom code and Function constructors taking function code as string. |
EnableDebugging | Boolean | false | Flag for whether to enable debug mode. |
LocalTimeZone | TimeZoneInfo | TimeZoneInfo.Local | Local time zone for the Date objects in the script. |
MaxArraySize | UInt32 | UInt32.MaxValue | Maximum size for JavaScript array. |
MaxJsonParseDepth | Int32 | 64 | Maximum depth allowed when parsing JSON data using the JSON.parse static method. |
MaxRecursionDepth | Int32 | -1 | Maximum allowed depth of recursion:
|
MaxStatements | Int32 | 0 | Maximum number of statements. |
MemoryLimit | Int64 | 0 | Current memory limit for a engine in bytes. |
RegexTimeoutInterval | Nullable<TimeSpan> | null | Timeout interval for regular expressions. If the value of this property is null, then the value of regular expression timeout interval are taken from the |
RetainFunctionSourceText | Boolean | true | Flag for whether to retain the full source text of parsed functions. When this property is set to |
StrictMode | Boolean | false | Flag for whether to allow run the script in strict mode. |
TimeoutInterval | TimeSpan | TimeSpan.Zero | Interval to wait before the script execution times out. |