Skip to content

Commit 4377709

Browse files
committed
In JavaScriptEngineSwitcher.Yantra added support for the YantraJS version 1.2.242
1 parent ab198c1 commit 4377709

File tree

5 files changed

+7
-145
lines changed

5 files changed

+7
-145
lines changed

src/JavaScriptEngineSwitcher.Yantra/JavaScriptEngineSwitcher.Yantra.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
<PackageIconFullPath>../../Icons/JavaScriptEngineSwitcher_Yantra_Logo128x128.png</PackageIconFullPath>
2020
<Description>JavaScriptEngineSwitcher.Yantra contains a `YantraJsEngine` adapter (wrapper for the YantraJS).</Description>
2121
<PackageTags>$(PackageCommonTags);Yantra;YantraJS</PackageTags>
22-
<PackageReleaseNotes>YantraJS was updated to version 1.2.238.</PackageReleaseNotes>
22+
<PackageReleaseNotes>YantraJS was updated to version 1.2.242.</PackageReleaseNotes>
2323
</PropertyGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="YantraJS.Core" Version="1.2.238" />
26+
<PackageReference Include="YantraJS.Core" Version="1.2.242" />
2727

2828
<ProjectReference Include="../JavaScriptEngineSwitcher.Core/JavaScriptEngineSwitcher.Core.csproj" />
2929
</ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
JavaScriptEngineSwitcher.Yantra contains a `YantraJsEngine` adapter (wrapper for the [YantraJS](https://yantrajs.com) version 1.2.238).
1+
JavaScriptEngineSwitcher.Yantra contains a `YantraJsEngine` adapter (wrapper for the [YantraJS](https://yantrajs.com) version 1.2.242).

src/JavaScriptEngineSwitcher.Yantra/YantraJsEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public sealed class YantraJsEngine : JsEngineBase
4949
/// <summary>
5050
/// Version of original JS engine
5151
/// </summary>
52-
private const string EngineVersion = "1.2.238";
52+
private const string EngineVersion = "1.2.242";
5353

5454
/// <summary>
5555
/// Regular expression for working with the error message

src/JavaScriptEngineSwitcher.Yantra/readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
DESCRIPTION
1313
===========
1414
JavaScriptEngineSwitcher.Yantra contains a `YantraJsEngine` adapter (wrapper for the
15-
YantraJS (https://yantrajs.com) version 1.2.238).
15+
YantraJS (https://yantrajs.com) version 1.2.242).
1616

1717
=============
1818
RELEASE NOTES
1919
=============
20-
YantraJS was updated to version 1.2.238.
20+
YantraJS was updated to version 1.2.242.
2121

2222
=============
2323
DOCUMENTATION
Lines changed: 1 addition & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,10 @@
1-
using Xunit;
2-
3-
namespace JavaScriptEngineSwitcher.Tests.Yantra
1+
namespace JavaScriptEngineSwitcher.Tests.Yantra
42
{
53
public class Es5Tests : Es5TestsBase
64
{
75
protected override string EngineName
86
{
97
get { return "YantraJsEngine"; }
108
}
11-
12-
13-
#region Array methods
14-
15-
[Fact]
16-
public override void SupportsArrayIndexOfMethod()
17-
{
18-
// Arrange
19-
const string initCode = "var arr = [2, 5, 9, 2]";
20-
21-
const string input1 = "arr.indexOf(2);";
22-
const int targetOutput1 = 0;
23-
24-
const string input2 = "arr.indexOf(7);";
25-
const int targetOutput2 = -1;
26-
27-
const string input3 = "arr.indexOf(2, 3)";
28-
const int targetOutput3 = 3;
29-
30-
const string input4 = "arr.indexOf(2, 2);";
31-
const int targetOutput4 = 3;
32-
33-
const string input5 = "arr.indexOf(2, -2);";
34-
#if NET9_0_OR_GREATER
35-
const int targetOutput5 = 0;
36-
#else
37-
const int targetOutput5 = 3;
38-
#endif
39-
40-
const string input6 = "arr.indexOf(2, -1);";
41-
#if NET9_0_OR_GREATER
42-
const int targetOutput6 = 0;
43-
#else
44-
const int targetOutput6 = 3;
45-
#endif
46-
47-
const string input7 = "[].lastIndexOf(2, 0);";
48-
const int targetOutput7 = -1;
49-
50-
// Act
51-
int output1;
52-
int output2;
53-
int output3;
54-
int output4;
55-
int output5;
56-
int output6;
57-
int output7;
58-
59-
using (var jsEngine = CreateJsEngine())
60-
{
61-
jsEngine.Execute(initCode);
62-
63-
output1 = jsEngine.Evaluate<int>(input1);
64-
output2 = jsEngine.Evaluate<int>(input2);
65-
output3 = jsEngine.Evaluate<int>(input3);
66-
output4 = jsEngine.Evaluate<int>(input4);
67-
output5 = jsEngine.Evaluate<int>(input5);
68-
output6 = jsEngine.Evaluate<int>(input6);
69-
output7 = jsEngine.Evaluate<int>(input7);
70-
}
71-
72-
// Assert
73-
Assert.Equal(targetOutput1, output1);
74-
Assert.Equal(targetOutput2, output2);
75-
Assert.Equal(targetOutput3, output3);
76-
Assert.Equal(targetOutput4, output4);
77-
Assert.Equal(targetOutput5, output5);
78-
Assert.Equal(targetOutput6, output6);
79-
Assert.Equal(targetOutput7, output7);
80-
}
81-
82-
[Fact]
83-
public override void SupportsArrayLastIndexOfMethod()
84-
{
85-
// Arrange
86-
const string initCode = "var arr = [2, 5, 9, 2]";
87-
88-
const string input1 = "arr.lastIndexOf(2);";
89-
const int targetOutput1 = 3;
90-
91-
const string input2 = "arr.lastIndexOf(7);";
92-
const int targetOutput2 = -1;
93-
94-
const string input3 = "arr.lastIndexOf(2, 3)";
95-
const int targetOutput3 = 3;
96-
97-
const string input4 = "arr.lastIndexOf(2, 2);";
98-
const int targetOutput4 = 0;
99-
100-
const string input5 = "arr.lastIndexOf(2, -2);";
101-
const int targetOutput5 = 0;
102-
103-
const string input6 = "arr.lastIndexOf(2, -1);";
104-
#if NET9_0_OR_GREATER
105-
const int targetOutput6 = 0;
106-
#else
107-
const int targetOutput6 = 3;
108-
#endif
109-
110-
const string input7 = "[].lastIndexOf(2, 0);";
111-
const int targetOutput7 = -1;
112-
113-
// Act
114-
int output1;
115-
int output2;
116-
int output3;
117-
int output4;
118-
int output5;
119-
int output6;
120-
int output7;
121-
122-
using (var jsEngine = CreateJsEngine())
123-
{
124-
jsEngine.Execute(initCode);
125-
126-
output1 = jsEngine.Evaluate<int>(input1);
127-
output2 = jsEngine.Evaluate<int>(input2);
128-
output3 = jsEngine.Evaluate<int>(input3);
129-
output4 = jsEngine.Evaluate<int>(input4);
130-
output5 = jsEngine.Evaluate<int>(input5);
131-
output6 = jsEngine.Evaluate<int>(input6);
132-
output7 = jsEngine.Evaluate<int>(input7);
133-
}
134-
135-
// Assert
136-
Assert.Equal(targetOutput1, output1);
137-
Assert.Equal(targetOutput2, output2);
138-
Assert.Equal(targetOutput3, output3);
139-
Assert.Equal(targetOutput4, output4);
140-
Assert.Equal(targetOutput5, output5);
141-
Assert.Equal(targetOutput6, output6);
142-
Assert.Equal(targetOutput7, output7);
143-
}
144-
145-
#endregion
146-
1479
}
14810
}

0 commit comments

Comments
 (0)