forked from Taritsyn/JavaScriptEngineSwitcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJintConfiguration.cs
More file actions
65 lines (60 loc) · 1.98 KB
/
JintConfiguration.cs
File metadata and controls
65 lines (60 loc) · 1.98 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
namespace JavaScriptEngineSwitcher.Jint.Configuration
{
using System.Configuration;
/// <summary>
/// Configuration settings of Jint JavaScript engine
/// </summary>
public sealed class JintConfiguration : ConfigurationSection
{
/// <summary>
/// Gets or sets a flag for whether to enable script debugging features
/// (allows a <code>debugger</code> statement to be called in a script)
/// </summary>
[ConfigurationProperty("enableDebugging", DefaultValue = false)]
public bool EnableDebugging
{
get { return (bool)this["enableDebugging"]; }
set { this["enableDebugging"] = value; }
}
/// <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>
[ConfigurationProperty("maxRecursionDepth", DefaultValue = -1)]
[IntegerValidator(MinValue = -1, MaxValue = int.MaxValue, ExcludeRange = false)]
public int MaxRecursionDepth
{
get { return (int)this["maxRecursionDepth"]; }
set { this["maxRecursionDepth"] = value; }
}
/// <summary>
/// Gets or sets a maximum number of statements
/// </summary>
[ConfigurationProperty("maxStatements", DefaultValue = 0)]
[IntegerValidator(MinValue = 0, MaxValue = int.MaxValue, ExcludeRange = false)]
public int MaxStatements
{
get { return (int)this["maxStatements"]; }
set { this["maxStatements"] = value; }
}
/// <summary>
/// Gets or sets a flag for whether to allow run the script in strict mode
/// </summary>
[ConfigurationProperty("strictMode", DefaultValue = false)]
public bool StrictMode
{
get { return (bool)this["strictMode"]; }
set { this["strictMode"] = value; }
}
/// <summary>
/// Gets or sets a number of milliseconds to wait before the script execution times out
/// </summary>
[ConfigurationProperty("timeout", DefaultValue = 0)]
public int Timeout
{
get { return (int)this["timeout"]; }
set { this["timeout"] = value; }
}
}
}