Skip to content

Commit 5213fac

Browse files
committed
In JavaScriptEngineSwitcher.Node:
1. Jering.Javascript.NodeJS was updated to version 6.2.0; 2. Added support of .NET Core App 3.1 and .NET 5.0.
1 parent d10998f commit 5213fac

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

src/JavaScriptEngineSwitcher.Node/DefaultNodeJsService.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ public Task InvokeFromFileAsync(string modulePath, string exportName = null, obj
4848
return StaticNodeJSService.InvokeFromFileAsync(modulePath, exportName, args, cancellationToken);
4949
}
5050

51-
public Task<T> InvokeFromStringAsync<T>(string moduleString, string newCacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
51+
public Task<T> InvokeFromStringAsync<T>(string moduleString, string cacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
5252
{
53-
return StaticNodeJSService.InvokeFromStringAsync<T>(moduleString, newCacheIdentifier, exportName, args, cancellationToken);
53+
return StaticNodeJSService.InvokeFromStringAsync<T>(moduleString, cacheIdentifier, exportName, args, cancellationToken);
5454
}
5555

56-
public Task InvokeFromStringAsync(string moduleString, string newCacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
56+
public Task InvokeFromStringAsync(string moduleString, string cacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
5757
{
58-
return StaticNodeJSService.InvokeFromStringAsync(moduleString, newCacheIdentifier, exportName, args, cancellationToken);
58+
return StaticNodeJSService.InvokeFromStringAsync(moduleString, cacheIdentifier, exportName, args, cancellationToken);
5959
}
6060

6161
public Task<T> InvokeFromStringAsync<T>(Func<string> moduleFactory, string cacheIdentifier, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
@@ -68,14 +68,14 @@ public Task InvokeFromStringAsync(Func<string> moduleFactory, string cacheIdenti
6868
return StaticNodeJSService.InvokeFromStringAsync(moduleFactory, cacheIdentifier, exportName, args, cancellationToken);
6969
}
7070

71-
public Task<T> InvokeFromStreamAsync<T>(Stream moduleStream, string newCacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
71+
public Task<T> InvokeFromStreamAsync<T>(Stream moduleStream, string cacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
7272
{
73-
return StaticNodeJSService.InvokeFromStreamAsync<T>(moduleStream, newCacheIdentifier, exportName, args, cancellationToken);
73+
return StaticNodeJSService.InvokeFromStreamAsync<T>(moduleStream, cacheIdentifier, exportName, args, cancellationToken);
7474
}
7575

76-
public Task InvokeFromStreamAsync(Stream moduleStream, string newCacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
76+
public Task InvokeFromStreamAsync(Stream moduleStream, string cacheIdentifier = null, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
7777
{
78-
return StaticNodeJSService.InvokeFromStreamAsync(moduleStream, newCacheIdentifier, exportName, args, cancellationToken);
78+
return StaticNodeJSService.InvokeFromStreamAsync(moduleStream, cacheIdentifier, exportName, args, cancellationToken);
7979
}
8080

8181
public Task<T> InvokeFromStreamAsync<T>(Func<Stream> moduleFactory, string cacheIdentifier, string exportName = null, object[] args = null, CancellationToken cancellationToken = default)
@@ -98,6 +98,11 @@ public Task<bool> TryInvokeFromCacheAsync(string moduleCacheIdentifier, string e
9898
return StaticNodeJSService.TryInvokeFromCacheAsync(moduleCacheIdentifier, exportName, args, cancellationToken);
9999
}
100100

101+
public void MoveToNewProcess()
102+
{
103+
throw new NotSupportedException();
104+
}
105+
101106
#region IDisposable implementation
102107

103108
public void Dispose()

src/JavaScriptEngineSwitcher.Node/JavaScriptEngineSwitcher.Node.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Product>JS Engine Switcher: Node</Product>
55
<VersionPrefix>3.10.0</VersionPrefix>
6-
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
6+
<TargetFrameworks>net461;netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
77
<OutputType>Library</OutputType>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -17,16 +17,17 @@
1717
<Import Project="../../build/nuget-for-dotnet-lib.props" />
1818

1919
<PropertyGroup>
20-
<Description>JavaScriptEngineSwitcher.Node contains adapter `NodeJsEngine` (wrapper for the Jering.Javascript.NodeJS (https://github.com/JeringTech/Javascript.NodeJS) version 5.4.4).
20+
<Description>JavaScriptEngineSwitcher.Node contains adapter `NodeJsEngine` (wrapper for the Jering.Javascript.NodeJS (https://github.com/JeringTech/Javascript.NodeJS) version 6.2.0).
2121

2222
This package does not contain the `node.exe`. Therefore, you need to install the Node.js (https://nodejs.org) and add the `node.exe`'s directory to the `Path` environment variable (automatically done by the official installer).</Description>
2323
<PackageTags>$(PackageCommonTags);Node.js;Jering.Javascript.NodeJS</PackageTags>
2424
<PackageIconFullPath>../../Icons/JavaScriptEngineSwitcher_Node_Logo128x128.png</PackageIconFullPath>
25-
<PackageReleaseNotes>Jering.Javascript.NodeJS was updated to version 5.4.4.</PackageReleaseNotes>
25+
<PackageReleaseNotes>1. Jering.Javascript.NodeJS was updated to version 6.2.0;
26+
2. Added support of .NET Core App 3.1 and .NET 5.0.</PackageReleaseNotes>
2627
</PropertyGroup>
2728

2829
<ItemGroup>
29-
<PackageReference Include="Jering.Javascript.NodeJS" Version="5.4.4" />
30+
<PackageReference Include="Jering.Javascript.NodeJS" Version="6.2.0" />
3031

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

src/JavaScriptEngineSwitcher.Node/NodeJsEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public NodeJsEngine(INodeJSService service, NodeSettings settings)
133133
{
134134
Task<string> versionTask = _jsService.InvokeFromStringAsync<string>(
135135
@"module.exports = (callback) => {
136-
var version = process.versions.node;
136+
let version = process.versions.node;
137137
callback(null , version);
138138
};"
139139
);

src/JavaScriptEngineSwitcher.Node/Resources/engine-helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ module.exports = {
131131
delete context[variableName];
132132
}
133133

134-
callback(null, undefined);
134+
callback(null);
135135
}
136136
};

src/JavaScriptEngineSwitcher.Node/readme.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
===========
1414
JavaScriptEngineSwitcher.Node contains adapter `NodeJsEngine` (wrapper for the
1515
Jering.Javascript.NodeJS (https://github.com/JeringTech/Javascript.NodeJS)
16-
version 5.4.4).
16+
version 6.2.0).
1717

1818
This package does not contain the `node.exe`. Therefore, you need to install the
1919
Node.js (https://nodejs.org) and add the `node.exe`'s directory to the `Path`
@@ -22,7 +22,8 @@
2222
=============
2323
RELEASE NOTES
2424
=============
25-
Jering.Javascript.NodeJS was updated to version 5.4.4.
25+
1. Jering.Javascript.NodeJS was updated to version 6.2.0;
26+
2. Added support of .NET Core App 3.1 and .NET 5.0.
2627

2728
=============
2829
DOCUMENTATION

0 commit comments

Comments
 (0)