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 11{
22 "sdk" : {
3- "version" : " 6.0.201 "
3+ "version" : " 6.0.202 "
44 }
55}
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 44using Jint ;
55using IOriginalPrimitiveInstance = Jint . Native . IPrimitiveInstance ;
66using OriginalCancellationConstraint = Jint . Constraints . CancellationConstraint ;
7- using OriginalDebuggerBreakDelegate = Jint . Runtime . Debugger . DebugHandler . BreakDelegate ;
7+ using OriginalDebuggerEventHandler = Jint . Runtime . Debugger . DebugHandler . DebugEventHandler ;
88using OriginalDebuggerStatementHandlingMode = Jint . Runtime . Debugger . DebuggerStatementHandling ;
9- using OriginalDebuggerStepDelegate = Jint . Runtime . Debugger . DebugHandler . DebugStepDelegate ;
109using OriginalEngine = Jint . Engine ;
1110using OriginalExecutionCanceledException = Jint . Runtime . ExecutionCanceledException ;
1211using 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
Original file line number Diff line number Diff line change 11using 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
65namespace 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 ;
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments