Taritsyn edited this page Dec 25, 2018 · 2 revisions

JavaScriptEngineSwitcher.Jint contains adapter JintJsEngine (wrapper for the Jint version 2.11.58).

Engine settings

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
AllowDebuggerStatement Boolean false Flag for whether to allow the debugger statement to be called in a script.
EnableDebugging Boolean false Flag for whether to enable debug mode.
LocalTimeZone TimeZoneInfo TimeZoneInfo.Local Local time zone for the Date objects in the script.
MaxRecursionDepth Int32 -1 Maximum allowed depth of recursion:
  • -1 - recursion without limits;
  • N - one scope function can be called no more than N times.
MaxStatements Int32 0 Maximum number of statements.
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.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.