Skip to content

Commit 4e17f1d

Browse files
committed
In JavaScriptEngineSwitcher.ChakraCore was explicitly specified charset in the JsCreateString, JsCopyString and JsCreatePropertyId methods of NativeMethods class
1 parent e0db6a8 commit 4e17f1d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/JavaScriptEngineSwitcher.ChakraCore/JavaScriptEngineSwitcher.ChakraCore.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ This package does not contain the native implementations of ChakraCore. Therefor
2424
<PackageIconUrl>https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png</PackageIconUrl>
2525
<PackageTags>JavaScriptEngineSwitcher;JavaScript;ECMAScript;ChakraCore</PackageTags>
2626
<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>
27+
2. Charset was explicitly specified in the `JsCreateString`, `JsCopyString` and `JsCreatePropertyId` methods of `NativeMethods` class;
28+
3. Added a `netcoreapp2.1` target.</PackageReleaseNotes>
2829
</PropertyGroup>
2930

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

src/JavaScriptEngineSwitcher.ChakraCore/JsRt/NativeMethods.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,13 @@ internal static extern JsErrorCode JsSetPromiseContinuationCallback(
334334

335335
#region Hosting
336336

337-
[DllImport(DllName.Universal, CallingConvention = DefaultCallingConvention)]
337+
[DllImport(DllName.Universal, CallingConvention = DefaultCallingConvention, CharSet = CharSet.Ansi)]
338338
internal static extern JsErrorCode JsCreateString(string content, UIntPtr length, out JsValue value);
339339

340340
[DllImport(DllName.Universal, CallingConvention = DefaultCallingConvention, CharSet = CharSet.Unicode)]
341341
internal static extern JsErrorCode JsCreateStringUtf16(string content, UIntPtr length, out JsValue value);
342342

343-
[DllImport(DllName.Universal, CallingConvention = DefaultCallingConvention)]
343+
[DllImport(DllName.Universal, CallingConvention = DefaultCallingConvention, CharSet = CharSet.Ansi)]
344344
internal static extern JsErrorCode JsCopyString(JsValue value, byte[] buffer, UIntPtr bufferSize,
345345
out UIntPtr length);
346346

@@ -356,7 +356,7 @@ internal static extern JsErrorCode JsParse(JsValue script, JsSourceContext sourc
356356
internal static extern JsErrorCode JsRun(JsValue script, JsSourceContext sourceContext, JsValue sourceUrl,
357357
JsParseScriptAttributes parseAttributes, out JsValue result);
358358

359-
[DllImport(DllName.Universal, CallingConvention = DefaultCallingConvention)]
359+
[DllImport(DllName.Universal, CallingConvention = DefaultCallingConvention, CharSet = CharSet.Ansi)]
360360
internal static extern JsErrorCode JsCreatePropertyId(string name, UIntPtr length,
361361
out JsPropertyId propertyId);
362362

src/JavaScriptEngineSwitcher.ChakraCore/readme.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
=============
3333
1. In the `NativeMethods` class for the `netstandard` and `netcoreapp` targets
3434
was changed a calling convention from `StdCall` to `Cdecl`;
35-
2. Added a `netcoreapp2.1` target.
35+
2. Charset was explicitly specified in the `JsCreateString`, `JsCopyString` and
36+
`JsCreatePropertyId` methods of `NativeMethods` class;
37+
3. Added a `netcoreapp2.1` target.
3638

3739
=============
3840
DOCUMENTATION

0 commit comments

Comments
 (0)