Skip to content

Commit 622336b

Browse files
committed
In JavaScriptEngineSwitcher.ChakraCore added a netcoreapp2.1 target
1 parent 26910f6 commit 622336b

File tree

11 files changed

+20
-18
lines changed

11 files changed

+20
-18
lines changed

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
1414
</PropertyGroup>
1515

16-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netcoreapp2.0' ">
16+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netcoreapp2.0' Or '$(TargetFramework)' == 'netcoreapp2.1' ">
1717
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
1818
</PropertyGroup>
1919
</Project>

src/JavaScriptEngineSwitcher.ChakraCore/AssemblyResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !NETSTANDARD
1+
#if NETFULL
22
using System;
33
using System.IO;
44
using System.Runtime.InteropServices;

src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public sealed class ChakraCoreJsEngine : JsEngineBase
101101
/// </summary>
102102
private readonly UniqueDocumentNameManager _documentNameManager =
103103
new UniqueDocumentNameManager(DefaultDocumentName);
104-
#if !NETSTANDARD
104+
#if NETFULL
105105

106106
/// <summary>
107107
/// Synchronizer of JS engine initialization
@@ -128,7 +128,7 @@ public ChakraCoreJsEngine()
128128
/// <param name="settings">Settings of the ChakraCore JS engine</param>
129129
public ChakraCoreJsEngine(ChakraCoreSettings settings)
130130
{
131-
#if !NETSTANDARD
131+
#if NETFULL
132132
Initialize();
133133

134134
#endif
@@ -207,7 +207,7 @@ public ChakraCoreJsEngine(ChakraCoreSettings settings)
207207
Dispose(false);
208208
}
209209

210-
#if !NETSTANDARD
210+
#if NETFULL
211211

212212
/// <summary>
213213
/// Initializes a JS engine

src/JavaScriptEngineSwitcher.ChakraCore/Helpers/EncodingHelpers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NET471 || NETSTANDARD
1+
#if NET471 || NETSTANDARD || NETCOREAPP2_1
22
using System;
33
using System.Runtime.InteropServices;
44
#endif
@@ -11,7 +11,7 @@ namespace JavaScriptEngineSwitcher.ChakraCore.Helpers
1111
/// </summary>
1212
internal static class EncodingHelpers
1313
{
14-
#if NET471 || NETSTANDARD
14+
#if NET471 || NETSTANDARD || NETCOREAPP2_1
1515
public static unsafe string UnicodeToUtf8(string value, out int byteCount)
1616
#else
1717
public static string UnicodeToUtf8(string value, out int byteCount)
@@ -24,7 +24,7 @@ public static string UnicodeToUtf8(string value, out int byteCount)
2424
}
2525

2626
string result;
27-
#if NET471 || NETSTANDARD
27+
#if NET471 || NETSTANDARD || NETCOREAPP2_1
2828
byteCount = Encoding.UTF8.GetByteCount(value);
2929
IntPtr bufferPtr = Marshal.AllocHGlobal(byteCount);
3030

src/JavaScriptEngineSwitcher.ChakraCore/JavaScriptEngineSwitcher.ChakraCore.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Product>JS Engine Switcher: ChakraCore</Product>
55
<VersionPrefix>3.0.0</VersionPrefix>
66
<VersionSuffix>rc1</VersionSuffix>
7-
<TargetFrameworks>net40-client;net45;net471;netstandard1.3;netstandard2.0</TargetFrameworks>
7+
<TargetFrameworks>net40-client;net45;net471;netstandard1.3;netstandard2.0;netcoreapp2.1</TargetFrameworks>
88
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
99
<OutputType>Library</OutputType>
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -23,7 +23,8 @@ This package does not contain the native implementations of ChakraCore. Therefor
2323
* JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64</Description>
2424
<PackageIconUrl>https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png</PackageIconUrl>
2525
<PackageTags>JavaScriptEngineSwitcher;JavaScript;ECMAScript;ChakraCore</PackageTags>
26-
<PackageReleaseNotes>In the `NativeMethods` class for the `netstandard` targets was changed a calling convention from `StdCall` to `Cdecl`.</PackageReleaseNotes>
26+
<PackageReleaseNotes>1. In the `NativeMethods` class for the `netstandard` and `netcoreapp` targets was changed a calling convention from `StdCall` to `Cdecl`;
27+
2. Added a `netcoreapp2.1` target.</PackageReleaseNotes>
2728
</PropertyGroup>
2829

2930
<Import Project="../../build/common.props" />

src/JavaScriptEngineSwitcher.ChakraCore/JsRt/JsContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
#if NET45 || NET471 || NETSTANDARD
2+
#if NET45 || NET471 || NETSTANDARD || NETCOREAPP2_1
33
using System.Runtime.InteropServices;
44
#endif
55
using System.Text;

src/JavaScriptEngineSwitcher.ChakraCore/JsRt/JsPropertyId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
#if NET45 || NET471 || NETSTANDARD
2+
#if NET45 || NET471 || NETSTANDARD || NETCOREAPP2_1
33
using System.Buffers;
44
using System.Runtime.InteropServices;
55
#endif

src/JavaScriptEngineSwitcher.ChakraCore/JsRt/JsValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
#if NET45 || NET471 || NETSTANDARD
2+
#if NET45 || NET471 || NETSTANDARD || NETCOREAPP2_1
33
using System.Buffers;
44
#endif
55
using System.Runtime.InteropServices;

src/JavaScriptEngineSwitcher.ChakraCore/JsRt/NativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace JavaScriptEngineSwitcher.ChakraCore.JsRt
1010
/// </summary>
1111
internal static class NativeMethods
1212
{
13-
#if NETSTANDARD
13+
#if NETSTANDARD || NETCOREAPP2_1
1414
private const CallingConvention DefaultCallingConvention = CallingConvention.Cdecl;
1515
#else
1616
private const CallingConvention DefaultCallingConvention = CallingConvention.StdCall;

src/JavaScriptEngineSwitcher.ChakraCore/ScriptDispatcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Runtime.CompilerServices;
4-
#if NET45 || NET471 || NETSTANDARD
4+
#if NET45 || NET471 || NETSTANDARD || NETCOREAPP2_1
55
using System.Runtime.ExceptionServices;
66
#endif
77
using System.Threading;
@@ -155,7 +155,7 @@ private object InnnerInvoke(Func<object> del)
155155
Exception exception = task.Exception;
156156
if (exception != null)
157157
{
158-
#if NET45 || NET471 || NETSTANDARD
158+
#if NET45 || NET471 || NETSTANDARD || NETCOREAPP2_1
159159
ExceptionDispatchInfo.Capture(exception).Throw();
160160
#elif NET40
161161
exception.PreserveStackTrace();

0 commit comments

Comments
 (0)