File tree Expand file tree Collapse file tree 6 files changed +56
-15
lines changed
src/JavaScriptEngineSwitcher.Jint
test/JavaScriptEngineSwitcher.Tests/Jint Expand file tree Collapse file tree 6 files changed +56
-15
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"sdk" : {
3
- "version" : " 6.0.201 "
3
+ "version" : " 6.0.202 "
4
4
}
5
5
}
Original file line number Diff line number Diff line change 18
18
<Import Project =" ../../build/nuget-for-dotnet-lib.props" />
19
19
20
20
<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 >
22
22
<PackageTags >$(PackageCommonTags);Jint</PackageTags >
23
23
<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 >
25
26
</PropertyGroup >
26
27
27
28
<ItemGroup >
28
29
<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 " />
30
31
31
32
<ProjectReference Include =" ../JavaScriptEngineSwitcher.Core/JavaScriptEngineSwitcher.Core.csproj" />
32
33
</ItemGroup >
Original file line number Diff line number Diff line change 4
4
using Jint ;
5
5
using IOriginalPrimitiveInstance = Jint . Native . IPrimitiveInstance ;
6
6
using OriginalCancellationConstraint = Jint . Constraints . CancellationConstraint ;
7
- using OriginalDebuggerBreakDelegate = Jint . Runtime . Debugger . DebugHandler . BreakDelegate ;
7
+ using OriginalDebuggerEventHandler = Jint . Runtime . Debugger . DebugHandler . DebugEventHandler ;
8
8
using OriginalDebuggerStatementHandlingMode = Jint . Runtime . Debugger . DebuggerStatementHandling ;
9
- using OriginalDebuggerStepDelegate = Jint . Runtime . Debugger . DebugHandler . DebugStepDelegate ;
10
9
using OriginalEngine = Jint . Engine ;
11
10
using OriginalExecutionCanceledException = Jint . Runtime . ExecutionCanceledException ;
12
11
using OriginalJavaScriptException = Jint . Runtime . JavaScriptException ;
@@ -52,7 +51,7 @@ public sealed class JintJsEngine : JsEngineBase
52
51
/// <summary>
53
52
/// Version of original JS engine
54
53
/// </summary>
55
- private const string EngineVersion = "3.0.0 Beta 2037 " ;
54
+ private const string EngineVersion = "3.0.0 Beta 2038 " ;
56
55
57
56
/// <summary>
58
57
/// Jint JS engine
@@ -72,12 +71,12 @@ public sealed class JintJsEngine : JsEngineBase
72
71
/// <summary>
73
72
/// Debugger break callback
74
73
/// </summary>
75
- private OriginalDebuggerBreakDelegate _debuggerBreakCallback ;
74
+ private OriginalDebuggerEventHandler _debuggerBreakCallback ;
76
75
77
76
/// <summary>
78
77
/// Debugger step callback
79
78
/// </summary>
80
- private OriginalDebuggerStepDelegate _debuggerStepCallback ;
79
+ private OriginalDebuggerEventHandler _debuggerStepCallback ;
81
80
82
81
/// <summary>
83
82
/// Synchronizer of code execution
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
3
- using OriginalDebuggerBreakDelegate = Jint . Runtime . Debugger . DebugHandler . BreakDelegate ;
4
- using OriginalDebuggerStepDelegate = Jint . Runtime . Debugger . DebugHandler . DebugStepDelegate ;
3
+ using OriginalDebuggerEventHandler = Jint . Runtime . Debugger . DebugHandler . DebugEventHandler ;
5
4
6
5
namespace JavaScriptEngineSwitcher . Jint
7
6
{
@@ -24,7 +23,7 @@ public bool AllowDebuggerStatement
24
23
/// <summary>
25
24
/// Gets or sets a debugger break callback
26
25
/// </summary>
27
- public OriginalDebuggerBreakDelegate DebuggerBreakCallback
26
+ public OriginalDebuggerEventHandler DebuggerBreakCallback
28
27
{
29
28
get ;
30
29
set ;
@@ -42,7 +41,7 @@ public JsDebuggerStatementHandlingMode DebuggerStatementHandlingMode
42
41
/// <summary>
43
42
/// Gets or sets a debugger step callback
44
43
/// </summary>
45
- public OriginalDebuggerStepDelegate DebuggerStepCallback
44
+ public OriginalDebuggerEventHandler DebuggerStepCallback
46
45
{
47
46
get ;
48
47
set ;
Original file line number Diff line number Diff line change 13
13
===========
14
14
JavaScriptEngineSwitcher.Jint contains adapter `JintJsEngine` (wrapper for the
15
15
Jint JavaScript Engine (http://github.com/sebastienros/jint) version
16
- 3.0.0 Beta 2037 ).
16
+ 3.0.0 Beta 2038 ).
17
17
18
18
=============
19
19
RELEASE NOTES
20
20
=============
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.
22
25
23
26
=============
24
27
DOCUMENTATION
Original file line number Diff line number Diff line change @@ -339,6 +339,45 @@ public void MappingHostErrorDuringRecursiveExecutionOfFilesIsCorrect()
339
339
#endregion
340
340
341
341
#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
342
381
}
343
382
}
344
383
#endif
You can’t perform that action at this time.
0 commit comments