Skip to content

Commit 5b53f4e

Browse files
committed
In JavaScriptEngineSwitcher.Msie added support of MSIE JavaScript Engine version 2.0.0 Alpha 1
1 parent 35a3f68 commit 5b53f4e

File tree

17 files changed

+56
-37
lines changed

17 files changed

+56
-37
lines changed

NuGet/JavaScriptEngineSwitcher.ChakraCore/JavaScriptEngineSwitcher.ChakraCore.nuspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
For correct working of the ChakraCore require assemblies `msvcp120.dll` and `msvcr120.dll` from the Visual C++ Redistributable Packages for Visual Studio 2013.</description>
1616
<summary>JavaScriptEngineSwitcher.ChakraCore contains adapter `ChakraCoreJsEngine` (wrapper for the ChakraCore version 1.2).</summary>
17-
<releaseNotes>Added support of .NET Core 1.0.</releaseNotes>
1817
<copyright>Copyright (c) 2013-2016 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
1918
<language>en-US</language>
2019
<tags>JavaScriptEngineSwitcher JavaScript ECMAScript ChakraCore</tags>
@@ -27,6 +26,8 @@ For correct working of the ChakraCore require assemblies `msvcp120.dll` and `msv
2726
</group>
2827
<group targetFramework=".NETStandard1.3">
2928
<dependency id="System.Diagnostics.Tools" version="4.0.1" />
29+
<dependency id="System.Reflection.Extensions" version="4.0.1" />
30+
<dependency id="System.Reflection.TypeExtensions" version="4.1.0" />
3031
<dependency id="Microsoft.Extensions.PlatformAbstractions" version="1.0.0" />
3132
<dependency id="JavaScriptEngineSwitcher.Core" version="2.0.0-alpha1" />
3233
</group>

NuGet/JavaScriptEngineSwitcher.ChakraCore/readme.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
`msvcr120.dll` from the Visual C++ Redistributable Packages for Visual Studio
2222
2013.
2323

24-
=============
25-
RELEASE NOTES
26-
=============
27-
Added support of .NET Core 1.0.
28-
2924
====================
3025
POST-INSTALL ACTIONS
3126
====================

NuGet/JavaScriptEngineSwitcher.Msie/JavaScriptEngineSwitcher.Msie.nuspec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>JavaScriptEngineSwitcher.Msie contains adapter `MsieJsEngine` (wrapper for the MSIE JavaScript Engine for .Net (http://github.com/Taritsyn/MsieJavaScriptEngine)). For correct working of the MSIE JavaScript Engine it is recommended to install Internet Explorer 9 and above on a server.</description>
1414
<summary>JavaScriptEngineSwitcher.Msie contains adapter `MsieJsEngine` (wrapper for the MSIE JavaScript Engine for .Net).</summary>
15-
<releaseNotes>Removed dependency on `System.Configuration.dll` (no longer supported configuration by using the Web.config and App.config files).</releaseNotes>
15+
<releaseNotes>Added support of MSIE JavaScript Engine version 2.0.0 Alpha 1.</releaseNotes>
1616
<copyright>Copyright (c) 2013-2016 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
1717
<language>en-US</language>
1818
<tags>JavaScriptEngineSwitcher JavaScript ECMAScript MSIE IE Chakra</tags>
1919
<dependencies>
2020
<group targetFramework=".NETFramework4.0-Client">
21-
<dependency id="MsieJavaScriptEngine" version="1.7.1" />
21+
<dependency id="MsieJavaScriptEngine" version="2.0.0-alpha1" />
2222
<dependency id="JavaScriptEngineSwitcher.Core" version="2.0.0-alpha1" />
2323
</group>
2424
<group targetFramework=".NETFramework4.5.1">
25-
<dependency id="MsieJavaScriptEngine" version="1.7.1" />
25+
<dependency id="MsieJavaScriptEngine" version="2.0.0-alpha1" />
26+
<dependency id="JavaScriptEngineSwitcher.Core" version="2.0.0-alpha1" />
27+
</group>
28+
<group targetFramework=".NETStandard1.3">
29+
<dependency id="MsieJavaScriptEngine" version="2.0.0-alpha1" />
2630
<dependency id="JavaScriptEngineSwitcher.Core" version="2.0.0-alpha1" />
2731
</group>
2832
</dependencies>

NuGet/JavaScriptEngineSwitcher.Msie/build-package.cmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ xcopy "%project_bin_dir%\net451\%project_name%.dll" lib\net451\
1818
xcopy "%project_bin_dir%\net451\%project_name%.xml" lib\net451\
1919
xcopy "%project_bin_dir%\net451\ru-ru\%project_name%.resources.dll" lib\net451\ru-ru\
2020

21+
%dotnet_cli% build "%project_source_dir%" --framework netstandard1.3 --configuration Release --no-dependencies --no-incremental
22+
xcopy "%project_bin_dir%\netstandard1.3\%project_name%.dll" lib\netstandard1.3\
23+
xcopy "%project_bin_dir%\netstandard1.3\%project_name%.xml" lib\netstandard1.3\
24+
xcopy "%project_bin_dir%\netstandard1.3\ru-ru\%project_name%.resources.dll" lib\netstandard1.3\ru-ru\
25+
2126
copy "%licenses_dir%\msie-javascript-engine-license.txt" msie-javascript-engine-license.txt /Y
2227

2328
%nuget_package_manager% pack "..\%project_name%\%project_name%.nuspec"

NuGet/JavaScriptEngineSwitcher.Msie/readme.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
=============
2020
RELEASE NOTES
2121
=============
22-
Removed dependency on `System.Configuration.dll` (no longer supported
23-
configuration by using the Web.config and App.config files).
22+
Added support of MSIE JavaScript Engine version 2.0.0 Alpha 1.
2423

2524
=============
2625
DOCUMENTATION

samples/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4/JavaScriptEngineSwitcher.Sample.AspNet4.Mvc4.Net40.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<Project>{1baec601-b244-48d3-be27-351e133eef73}</Project>
165165
<Name>JavaScriptEngineSwitcher.V8.Net40</Name>
166166
</ProjectReference>
167-
<ProjectReference Include="..\JavaScriptEngineSwitcher.Sample.Logic.Net40\JavaScriptEngineSwitcher.Sample.Logic.Net40.csproj">
167+
<ProjectReference Include="..\JavaScriptEngineSwitcher.Sample.Logic\JavaScriptEngineSwitcher.Sample.Logic.Net40.csproj">
168168
<Project>{4e8dc7d0-8121-4fb3-9df5-788b755852a2}</Project>
169169
<Name>JavaScriptEngineSwitcher.Sample.Logic.Net40</Name>
170170
</ProjectReference>

samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/Startup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
using JavaScriptEngineSwitcher.ChakraCore;
99
using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
10+
using JavaScriptEngineSwitcher.Msie;
1011
using JavaScriptEngineSwitcher.Sample.Logic.Services;
1112

1213
namespace JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1
@@ -51,6 +52,7 @@ public void ConfigureServices(IServiceCollection services)
5152
options.DefaultEngineName = ChakraCoreJsEngine.EngineName
5253
)
5354
.AddChakraCore()
55+
.AddMsie()
5456
;
5557

5658
// Add framework services.

samples/JavaScriptEngineSwitcher.Sample.AspNetCore1.Mvc1/project.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.0-alpha1",
2+
"version": "2.0.0-alpha2",
33

44
"dependencies": {
55
"Microsoft.NETCore.App": {
@@ -22,8 +22,9 @@
2222
"Microsoft.Extensions.Logging.Console": "1.0.0",
2323
"Microsoft.Extensions.Logging.Debug": "1.0.0",
2424
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
25-
"JavaScriptEngineSwitcher.ChakraCore": "2.0.0-alpha1",
25+
"JavaScriptEngineSwitcher.ChakraCore": "2.0.0-alpha2",
2626
"JavaScriptEngineSwitcher.Extensions.MsDependencyInjection": "2.0.0-alpha1",
27+
"JavaScriptEngineSwitcher.Msie": "2.0.0-alpha2",
2728
"JavaScriptEngineSwitcher.Sample.Logic": "2.0.0-alpha1"
2829
},
2930

samples/JavaScriptEngineSwitcher.Sample.AspNetCore1Full.Mvc1/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.0-alpha1",
2+
"version": "2.0.0-alpha2",
33

44
"dependencies": {
55
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
@@ -18,10 +18,10 @@
1818
"Microsoft.Extensions.Logging.Console": "1.0.0",
1919
"Microsoft.Extensions.Logging.Debug": "1.0.0",
2020
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
21-
"JavaScriptEngineSwitcher.ChakraCore": "2.0.0-alpha1",
21+
"JavaScriptEngineSwitcher.ChakraCore": "2.0.0-alpha2",
2222
"JavaScriptEngineSwitcher.Jint": "2.0.0-alpha1",
2323
"JavaScriptEngineSwitcher.Jurassic": "2.0.0-alpha1",
24-
"JavaScriptEngineSwitcher.Msie": "2.0.0-alpha1",
24+
"JavaScriptEngineSwitcher.Msie": "2.0.0-alpha2",
2525
"JavaScriptEngineSwitcher.Sample.Logic": "2.0.0-alpha1",
2626
"JavaScriptEngineSwitcher.Sample.Resources": "2.0.0-alpha1",
2727
"JavaScriptEngineSwitcher.V8": "2.0.0-alpha1",

src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public sealed class ChakraCoreJsEngine : JsEngineBase
5050
/// <summary>
5151
/// List of external objects
5252
/// </summary>
53-
private readonly ISet<object> _externalObjects;
53+
private ISet<object> _externalObjects = new HashSet<object>();
5454

5555
/// <summary>
5656
/// Callback for finalization of external object
@@ -60,7 +60,7 @@ public sealed class ChakraCoreJsEngine : JsEngineBase
6060
/// <summary>
6161
/// List of native function callbacks
6262
/// </summary>
63-
private readonly ISet<JsNativeFunction> _nativeFunctions;
63+
private ISet<JsNativeFunction> _nativeFunctions = new HashSet<JsNativeFunction>();
6464

6565
/// <summary>
6666
/// Gets a name of JS engine
@@ -104,9 +104,7 @@ public ChakraCoreJsEngine()
104104
EngineName, e.Message), EngineName, EngineVersion, e);
105105
}
106106

107-
_externalObjects = new HashSet<object>();
108107
_externalObjectFinalizeCallback = ExternalObjectFinalizeCallback;
109-
_nativeFunctions = new HashSet<JsNativeFunction>();
110108
}
111109

112110
/// <summary>
@@ -163,8 +161,18 @@ private void Dispose(bool disposing)
163161
{
164162
_jsRuntime.Dispose();
165163

166-
_externalObjects.Clear();
167-
_nativeFunctions.Clear();
164+
if (_externalObjects != null)
165+
{
166+
_externalObjects.Clear();
167+
_externalObjects = null;
168+
}
169+
170+
if (_nativeFunctions != null)
171+
{
172+
_nativeFunctions.Clear();
173+
_nativeFunctions = null;
174+
}
175+
168176
_externalObjectFinalizeCallback = null;
169177
}
170178
}

0 commit comments

Comments
 (0)