Skip to content

Commit c9f99e4

Browse files
committed
In JavaScriptEngineSwitcher.Jint in configuration settings of the Jint JS engine a Timeout property has been replaced by the TimeoutInterval property
1 parent 1f38c65 commit c9f99e4

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

src/JavaScriptEngineSwitcher.Jint/JavaScriptEngineSwitcher.Jint.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Description>JavaScriptEngineSwitcher.Jint contains adapter `JintJsEngine` (wrapper for the Jint JavaScript Engine (http://github.com/sebastienros/jint) version 2.11.58).</Description>
1414
<PackageIconUrl>https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_Jint_Logo128x128.png</PackageIconUrl>
1515
<PackageTags>JavaScriptEngineSwitcher;JavaScript;ECMAScript;Jint</PackageTags>
16-
<PackageReleaseNotes>Jint was updated to version 2.11.58.</PackageReleaseNotes>
16+
<PackageReleaseNotes>In configuration settings of the Jint JS engine a `Timeout` property has been replaced by the `TimeoutInterval` property (default `TimeSpan.Zero`).</PackageReleaseNotes>
1717
</PropertyGroup>
1818

1919
<Import Project="../../build/common.props" />

src/JavaScriptEngineSwitcher.Jint/JintJsEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public JintJsEngine(JintSettings settings)
8181
.LimitRecursion(jintSettings.MaxRecursionDepth)
8282
.MaxStatements(jintSettings.MaxStatements)
8383
.Strict(jintSettings.StrictMode)
84-
.TimeoutInterval(TimeSpan.FromMilliseconds(jintSettings.Timeout))
84+
.TimeoutInterval(jintSettings.TimeoutInterval)
8585
);
8686
}
8787
catch (Exception e)

src/JavaScriptEngineSwitcher.Jint/JintSettings.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace JavaScriptEngineSwitcher.Jint
1+
using System;
2+
3+
namespace JavaScriptEngineSwitcher.Jint
24
{
35
/// <summary>
46
/// Settings of the Jint JS engine
@@ -56,7 +58,17 @@ public bool StrictMode
5658
/// <summary>
5759
/// Gets or sets a number of milliseconds to wait before the script execution times out
5860
/// </summary>
61+
[Obsolete("Use a `TimeoutInterval` property")]
5962
public int Timeout
63+
{
64+
get { return TimeoutInterval.Milliseconds; }
65+
set { TimeoutInterval = TimeSpan.FromMilliseconds(value); }
66+
}
67+
68+
/// <summary>
69+
/// Gets or sets a interval to wait before the script execution times out
70+
/// </summary>
71+
public TimeSpan TimeoutInterval
6072
{
6173
get;
6274
set;
@@ -73,7 +85,7 @@ public JintSettings()
7385
MaxRecursionDepth = -1;
7486
MaxStatements = 0;
7587
StrictMode = false;
76-
Timeout = 0;
88+
TimeoutInterval = TimeSpan.Zero;
7789
}
7890
}
7991
}

src/JavaScriptEngineSwitcher.Jint/readme.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
=============
1818
RELEASE NOTES
1919
=============
20-
Jint was updated to version 2.11.58.
20+
In configuration settings of the Jint JS engine a `Timeout` property has been
21+
replaced by the `TimeoutInterval` property (default `TimeSpan.Zero`).
2122

2223
=============
2324
DOCUMENTATION

test/JavaScriptEngineSwitcher.Tests/Jint/CommonTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public void MappingTimeoutErrorDuringExecutionOfCodeIsCorrect()
289289
using (var jsEngine = new JintJsEngine(
290290
new JintSettings
291291
{
292-
Timeout = 30
292+
TimeoutInterval = TimeSpan.FromMilliseconds(30)
293293
}
294294
))
295295
{

0 commit comments

Comments
 (0)