Skip to content

Commit 939cec8

Browse files
committed
In JavaScriptEngineSwitcher.Jint:
1. Jint was updated to version 3.0.0 Beta 2038; 2. In configuration settings of the Jint JS engine were changed types of the `DebuggerBreakCallback` and `DebuggerStepCallback` properties to the `DebugEventHandler` type.
1 parent aa65c7a commit 939cec8

File tree

6 files changed

+56
-15
lines changed

6 files changed

+56
-15
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "6.0.201"
3+
"version": "6.0.202"
44
}
55
}

src/JavaScriptEngineSwitcher.Jint/JavaScriptEngineSwitcher.Jint.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
<Import Project="../../build/nuget-for-dotnet-lib.props" />
1919

2020
<PropertyGroup>
21-
<Description>JavaScriptEngineSwitcher.Jint contains adapter `JintJsEngine` (wrapper for the Jint JavaScript Engine (http://github.com/sebastienros/jint) version 3.0.0 Beta 2037).</Description>
21+
<Description>JavaScriptEngineSwitcher.Jint contains adapter `JintJsEngine` (wrapper for the Jint JavaScript Engine (http://github.com/sebastienros/jint) version 3.0.0 Beta 2038).</Description>
2222
<PackageTags>$(PackageCommonTags);Jint</PackageTags>
2323
<PackageIconFullPath>../../Icons/JavaScriptEngineSwitcher_Jint_Logo128x128.png</PackageIconFullPath>
24-
<PackageReleaseNotes>Jint was updated to version 3.0.0 Beta 2037.</PackageReleaseNotes>
24+
<PackageReleaseNotes>1. Jint was updated to version 3.0.0 Beta 2038;
25+
2. In configuration settings of the Jint JS engine were changed types of the `DebuggerBreakCallback` and `DebuggerStepCallback` properties to the `DebugEventHandler` type.</PackageReleaseNotes>
2526
</PropertyGroup>
2627

2728
<ItemGroup>
2829
<PackageReference Include="AdvancedStringBuilder" Version="0.1.0" />
29-
<PackageReference Include="Jint" Version="3.0.0-beta-2037" />
30+
<PackageReference Include="Jint" Version="3.0.0-beta-2038" />
3031

3132
<ProjectReference Include="../JavaScriptEngineSwitcher.Core/JavaScriptEngineSwitcher.Core.csproj" />
3233
</ItemGroup>

src/JavaScriptEngineSwitcher.Jint/JintJsEngine.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
using Jint;
55
using IOriginalPrimitiveInstance = Jint.Native.IPrimitiveInstance;
66
using OriginalCancellationConstraint = Jint.Constraints.CancellationConstraint;
7-
using OriginalDebuggerBreakDelegate = Jint.Runtime.Debugger.DebugHandler.BreakDelegate;
7+
using OriginalDebuggerEventHandler = Jint.Runtime.Debugger.DebugHandler.DebugEventHandler;
88
using OriginalDebuggerStatementHandlingMode = Jint.Runtime.Debugger.DebuggerStatementHandling;
9-
using OriginalDebuggerStepDelegate = Jint.Runtime.Debugger.DebugHandler.DebugStepDelegate;
109
using OriginalEngine = Jint.Engine;
1110
using OriginalExecutionCanceledException = Jint.Runtime.ExecutionCanceledException;
1211
using OriginalJavaScriptException = Jint.Runtime.JavaScriptException;
@@ -52,7 +51,7 @@ public sealed class JintJsEngine : JsEngineBase
5251
/// <summary>
5352
/// Version of original JS engine
5453
/// </summary>
55-
private const string EngineVersion = "3.0.0 Beta 2037";
54+
private const string EngineVersion = "3.0.0 Beta 2038";
5655

5756
/// <summary>
5857
/// Jint JS engine
@@ -72,12 +71,12 @@ public sealed class JintJsEngine : JsEngineBase
7271
/// <summary>
7372
/// Debugger break callback
7473
/// </summary>
75-
private OriginalDebuggerBreakDelegate _debuggerBreakCallback;
74+
private OriginalDebuggerEventHandler _debuggerBreakCallback;
7675

7776
/// <summary>
7877
/// Debugger step callback
7978
/// </summary>
80-
private OriginalDebuggerStepDelegate _debuggerStepCallback;
79+
private OriginalDebuggerEventHandler _debuggerStepCallback;
8180

8281
/// <summary>
8382
/// Synchronizer of code execution

src/JavaScriptEngineSwitcher.Jint/JintSettings.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22

3-
using OriginalDebuggerBreakDelegate = Jint.Runtime.Debugger.DebugHandler.BreakDelegate;
4-
using OriginalDebuggerStepDelegate = Jint.Runtime.Debugger.DebugHandler.DebugStepDelegate;
3+
using OriginalDebuggerEventHandler = Jint.Runtime.Debugger.DebugHandler.DebugEventHandler;
54

65
namespace JavaScriptEngineSwitcher.Jint
76
{
@@ -24,7 +23,7 @@ public bool AllowDebuggerStatement
2423
/// <summary>
2524
/// Gets or sets a debugger break callback
2625
/// </summary>
27-
public OriginalDebuggerBreakDelegate DebuggerBreakCallback
26+
public OriginalDebuggerEventHandler DebuggerBreakCallback
2827
{
2928
get;
3029
set;
@@ -42,7 +41,7 @@ public JsDebuggerStatementHandlingMode DebuggerStatementHandlingMode
4241
/// <summary>
4342
/// Gets or sets a debugger step callback
4443
/// </summary>
45-
public OriginalDebuggerStepDelegate DebuggerStepCallback
44+
public OriginalDebuggerEventHandler DebuggerStepCallback
4645
{
4746
get;
4847
set;

src/JavaScriptEngineSwitcher.Jint/readme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
===========
1414
JavaScriptEngineSwitcher.Jint contains adapter `JintJsEngine` (wrapper for the
1515
Jint JavaScript Engine (http://github.com/sebastienros/jint) version
16-
3.0.0 Beta 2037).
16+
3.0.0 Beta 2038).
1717

1818
=============
1919
RELEASE NOTES
2020
=============
21-
Jint was updated to version 3.0.0 Beta 2037.
21+
1. Jint was updated to version 3.0.0 Beta 2038;
22+
2. In configuration settings of the Jint JS engine were changed types of the
23+
`DebuggerBreakCallback` and `DebuggerStepCallback` properties to the
24+
`DebugEventHandler` type.
2225

2326
=============
2427
DOCUMENTATION

test/JavaScriptEngineSwitcher.Tests/Jint/InteropTests.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,45 @@ public void MappingHostErrorDuringRecursiveExecutionOfFilesIsCorrect()
339339
#endregion
340340

341341
#endregion
342+
343+
344+
#region Embedding of types
345+
346+
#region Types with methods
347+
348+
#if NET471
349+
[Fact]
350+
public override void EmbeddingOfBuiltinReferenceTypeWithMethodsIsCorrect()
351+
{
352+
// Arrange
353+
Type mathType = typeof(Math);
354+
355+
const string input1 = "Math2.Max(5.37, 5.56)";
356+
const double targetOutput1 = 5.56;
357+
358+
const string input2 = "Math2.Log10(23)";
359+
const double targetOutput2 = 1.36172783601759;
360+
361+
// Act
362+
double output1;
363+
double output2;
364+
365+
using (var jsEngine = CreateJsEngine())
366+
{
367+
jsEngine.EmbedHostType("Math2", mathType);
368+
output1 = Math.Round(jsEngine.Evaluate<double>(input1), 2);
369+
output2 = Math.Round(jsEngine.Evaluate<double>(input2), 14);
370+
}
371+
372+
// Assert
373+
Assert.Equal(targetOutput1, output1);
374+
Assert.Equal(targetOutput2, output2);
375+
}
376+
#endif
377+
378+
#endregion
379+
380+
#endregion
342381
}
343382
}
344383
#endif

0 commit comments

Comments
 (0)