Skip to content

Commit ebe733a

Browse files
committed
In JavaScriptEngineSwitcher.ChakraCore accelerated a conversion of script types to host types
1 parent 8dc0cae commit ebe733a

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/JavaScriptEngineSwitcher.ChakraCore/JavaScriptEngineSwitcher.ChakraCore.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ This package does not contain the native implementations of ChakraCore. Therefor
2323
<PackageIconUrl>https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png</PackageIconUrl>
2424
<PackageTags>JavaScriptEngineSwitcher;JavaScript;ECMAScript;ChakraCore</PackageTags>
2525
<PackageReleaseNotes>1. Reduced a memory consumption in cases, where not used the embedding of objects and types;
26-
2. Fixed a wrong implementation of destruction of the embedded delegates.</PackageReleaseNotes>
26+
2. Fixed a wrong implementation of destruction of the embedded delegates;
27+
3. Accelerated a conversion of script types to host types.</PackageReleaseNotes>
2728
</PropertyGroup>
2829

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

src/JavaScriptEngineSwitcher.ChakraCore/JsRt/TypeMapper.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ public JsValue[] MapToScriptType(object[] args)
200200
public object MapToHostType(JsValue value)
201201
{
202202
JsValueType valueType = value.ValueType;
203-
JsValue processedValue;
204203
object result;
205204

206205
switch (valueType)
@@ -212,16 +211,13 @@ public object MapToHostType(JsValue value)
212211
result = Undefined.Value;
213212
break;
214213
case JsValueType.Boolean:
215-
processedValue = value.ConvertToBoolean();
216-
result = processedValue.ToBoolean();
214+
result = value.ToBoolean();
217215
break;
218216
case JsValueType.Number:
219-
processedValue = value.ConvertToNumber();
220-
result = NumericHelpers.CastDoubleValueToCorrectType(processedValue.ToDouble());
217+
result = NumericHelpers.CastDoubleValueToCorrectType(value.ToDouble());
221218
break;
222219
case JsValueType.String:
223-
processedValue = value.ConvertToString();
224-
result = processedValue.ToString();
220+
result = value.ToString();
225221
break;
226222
case JsValueType.Object:
227223
case JsValueType.Function:

src/JavaScriptEngineSwitcher.ChakraCore/readme.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
=============
3333
1. Reduced a memory consumption in cases, where not used the embedding of objects
3434
and types;
35-
2. Fixed a wrong implementation of destruction of the embedded delegates.
35+
2. Fixed a wrong implementation of destruction of the embedded delegates;
36+
3. Accelerated a conversion of script types to host types.
3637

3738
=============
3839
DOCUMENTATION

0 commit comments

Comments
 (0)