-
Notifications
You must be signed in to change notification settings - Fork 49
Jint
Taritsyn edited this page Mar 14, 2025
·
48 revisions
JavaScriptEngineSwitcher.Jint contains a JintJsEngine
adapter (wrapper for the Jint version 4.2.1).
You can specify a settings of JS engine during its registration:
engineSwitcher.EngineFactories
.AddJint(new JintSettings
{
StrictMode = true
})
;
If you manually create an instance of JS engine, then you can pass settings via the constructor:
IJsEngine engine = new JintJsEngine(
new JintSettings
{
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 |
DebuggerBreakCallback |
DebugEventHandler delegate |
null |
Debugger break 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 |
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. |
- Registration of JS engines
- Creating instances of JS engines
- JS engines
- Upgrade guides
- Additional reading and resources