forked from Taritsyn/JavaScriptEngineSwitcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJintSettings.cs
More file actions
101 lines (91 loc) · 2.01 KB
/
JintSettings.cs
File metadata and controls
101 lines (91 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
namespace JavaScriptEngineSwitcher.Jint
{
/// <summary>
/// Settings of the Jint JS engine
/// </summary>
public sealed class JintSettings
{
/// <summary>
/// Gets or sets a flag for whether to allow the <code>debugger</code> statement
/// to be called in a script
/// </summary>
public bool AllowDebuggerStatement
{
get;
set;
}
/// <summary>
/// Gets or sets a flag for whether to enable debug mode
/// </summary>
public bool EnableDebugging
{
get;
set;
}
/// <summary>
/// Gets or sets a local time zone for the <code>Date</code> objects in the script
/// </summary>
public TimeZoneInfo LocalTimeZone
{
get;
set;
}
/// <summary>
/// Gets or sets a maximum allowed depth of recursion:
/// -1 - recursion without limits;
/// N - one scope function can be called no more than N times.
/// </summary>
public int MaxRecursionDepth
{
get;
set;
}
/// <summary>
/// Gets or sets a maximum number of statements
/// </summary>
public int MaxStatements
{
get;
set;
}
/// <summary>
/// Gets or sets a flag for whether to allow run the script in strict mode
/// </summary>
public bool StrictMode
{
get;
set;
}
/// <summary>
/// Gets or sets a number of milliseconds to wait before the script execution times out
/// </summary>
[Obsolete("Use a `TimeoutInterval` property")]
public int Timeout
{
get { return TimeoutInterval.Milliseconds; }
set { TimeoutInterval = TimeSpan.FromMilliseconds(value); }
}
/// <summary>
/// Gets or sets a interval to wait before the script execution times out
/// </summary>
public TimeSpan TimeoutInterval
{
get;
set;
}
/// <summary>
/// Constructs an instance of the Jint settings
/// </summary>
public JintSettings()
{
AllowDebuggerStatement = false;
EnableDebugging = false;
LocalTimeZone = TimeZoneInfo.Local;
MaxRecursionDepth = -1;
MaxStatements = 0;
StrictMode = false;
TimeoutInterval = TimeSpan.Zero;
}
}
}