From ad9a94415a014aba5180def0198ebf9f7f82a944 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 22 Nov 2021 21:35:29 +0300 Subject: [PATCH 01/28] In test projects added support of .NET 6 --- build/common.props | 12 ---------- global.json | 2 +- .../ActiveScript/ActiveScriptException.cs | 2 +- ...ActiveScriptJsEngineBase.ScriptSiteBase.cs | 2 +- .../ActiveScript/ActiveScriptJsEngineBase.cs | 2 +- .../ActiveScriptJsErrorHelpers.cs | 2 +- .../ActiveScript/ActiveScriptWrapper32.cs | 2 +- .../ActiveScript/ActiveScriptWrapper64.cs | 2 +- .../ActiveScript/ActiveScriptWrapperBase.cs | 2 +- .../ChakraActiveScriptJsEngine.ScriptSite.cs | 2 +- .../ChakraActiveScriptJsEngine.cs | 2 +- .../ClassicActiveScriptJsEngine.ScriptSite.cs | 2 +- .../ClassicActiveScriptJsEngine.cs | 2 +- .../ActiveScript/Debugging/AppBreakFlags.cs | 2 +- .../ActiveScript/Debugging/BreakReason.cs | 2 +- .../Debugging/BreakResumeAction.cs | 2 +- .../ActiveScript/Debugging/BreakpointState.cs | 2 +- .../Debugging/DebugApplicationWrapper.cs | 2 +- .../ActiveScript/Debugging/DebugDocument.cs | 2 +- .../Debugging/DebugDocumentContext.cs | 2 +- .../ActiveScript/Debugging/DebugLineInfo.cs | 2 +- .../Debugging/DebugStackFrameDescriptor.cs | 2 +- .../Debugging/DocumentNameType.cs | 2 +- .../Debugging/ErrorResumeAction.cs | 2 +- .../Debugging/IActiveScriptDebug32.cs | 2 +- .../Debugging/IActiveScriptDebug64.cs | 2 +- .../Debugging/IActiveScriptErrorDebug.cs | 2 +- .../Debugging/IActiveScriptSiteDebug32.cs | 2 +- .../Debugging/IActiveScriptSiteDebug64.cs | 2 +- .../Debugging/IActiveScriptSiteDebugEx.cs | 2 +- .../Debugging/IApplicationDebugger.cs | 2 +- .../Debugging/IDebugApplication32.cs | 2 +- .../Debugging/IDebugApplication64.cs | 2 +- .../Debugging/IDebugApplicationNode.cs | 2 +- .../Debugging/IDebugApplicationThread.cs | 2 +- .../Debugging/IDebugAsyncOperation.cs | 2 +- .../Debugging/IDebugCodeContext.cs | 2 +- .../ActiveScript/Debugging/IDebugDocument.cs | 2 +- .../Debugging/IDebugDocumentContext.cs | 2 +- .../Debugging/IDebugDocumentInfo.cs | 2 +- .../Debugging/IDebugDocumentProvider.cs | 2 +- .../Debugging/IDebugDocumentText.cs | 2 +- .../ActiveScript/Debugging/IDebugProperty.cs | 2 +- .../Debugging/IDebugStackFrame.cs | 2 +- .../Debugging/IDebugStackFrameSniffer.cs | 2 +- .../Debugging/IDebugStackFrameSnifferEx32.cs | 2 +- .../Debugging/IDebugStackFrameSnifferEx64.cs | 2 +- .../Debugging/IDebugSyncOperation.cs | 2 +- .../Debugging/IDebugThreadCall32.cs | 2 +- .../Debugging/IDebugThreadCall64.cs | 2 +- .../Debugging/IEnumDebugApplicationNodes.cs | 2 +- .../Debugging/IEnumDebugCodeContexts.cs | 2 +- .../Debugging/IEnumDebugExpressionContexts.cs | 2 +- .../Debugging/IEnumDebugStackFrames.cs | 2 +- .../IEnumRemoteDebugApplicationThreads.cs | 2 +- .../Debugging/IProvideExpressionContexts.cs | 2 +- .../IRemoteDebugApplicationThread.cs | 2 +- .../Debugging/NullEnumDebugStackFrames.cs | 2 +- .../Debugging/ProcessDebugManagerWrapper.cs | 2 +- .../ActiveScript/Debugging/SourceTextAttrs.cs | 2 +- .../ActiveScript/Debugging/TextDocAttrs.cs | 2 +- .../ActiveScript/IActiveScript.cs | 2 +- .../ActiveScript/IActiveScriptError.cs | 2 +- .../IActiveScriptGarbageCollector.cs | 2 +- .../ActiveScript/IActiveScriptParse32.cs | 2 +- .../ActiveScript/IActiveScriptParse64.cs | 2 +- .../ActiveScript/IActiveScriptProperty.cs | 2 +- .../ActiveScript/IActiveScriptSite.cs | 2 +- .../IActiveScriptSiteInterruptPoll.cs | 2 +- .../ActiveScript/IActiveScriptWrapper.cs | 2 +- .../ActiveScript/JScriptRuntimeErrorNumber.cs | 2 +- .../ActiveScript/JScriptSyntaxErrorNumber.cs | 2 +- .../ActiveScript/ScriptGCType.cs | 2 +- .../ActiveScript/ScriptInfoFlags.cs | 2 +- .../ActiveScript/ScriptInterruptFlags.cs | 2 +- .../ActiveScript/ScriptItemFlags.cs | 2 +- .../ActiveScript/ScriptLanguageVersion.cs | 2 +- .../ActiveScript/ScriptProperty.cs | 2 +- .../ActiveScript/ScriptState.cs | 2 +- .../ActiveScript/ScriptTextFlags.cs | 2 +- .../ActiveScript/ScriptThreadId.cs | 2 +- .../ActiveScript/ScriptThreadState.cs | 2 +- .../ActiveScript/ScriptTypeLibFlags.cs | 2 +- src/MsieJavaScriptEngine/Constants/ClassId.cs | 2 +- .../Constants/ComErrorCode.cs | 2 +- .../Constants/SpecialMemberName.cs | 2 +- .../Helpers/ComHelpers.cs | 2 +- .../Helpers/ReflectionHelpers.cs | 6 ++--- .../Helpers/TypeMappingHelpers.cs | 2 +- src/MsieJavaScriptEngine/HostItemBase.cs | 2 +- src/MsieJavaScriptEngine/HostObject.cs | 2 +- src/MsieJavaScriptEngine/HostType.cs | 2 +- .../JsRt/Edge/EdgeJsValue.cs | 4 ++-- .../JsRt/Edge/EdgeNativeMethods.cs | 2 +- .../JsRt/Edge/EdgeTypeMapper.cs | 22 +++++++++---------- .../JsRt/Embedding/EmbeddedItem.cs | 2 +- .../JsRt/Embedding/EmbeddedObject.cs | 2 +- .../JsRt/Embedding/EmbeddedObjectKey.cs | 2 +- .../JsRt/Embedding/EmbeddedType.cs | 2 +- src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs | 4 ++-- .../JsRt/Ie/IeNativeMethods.cs | 2 +- .../JsRt/Ie/IeTypeMapper.cs | 18 +++++++-------- src/MsieJavaScriptEngine/JsRt/TypeMapper.cs | 16 +++++++------- src/MsieJavaScriptEngine/MsieJsEngine.cs | 10 ++++----- .../MsieJavaScriptEngine.Benchmarks.csproj | 4 ++-- .../MsieJavaScriptEngine.Test.Auto.csproj | 4 ++-- ...criptEngine.Test.ChakraActiveScript.csproj | 2 +- ...avaScriptEngine.Test.ChakraEdgeJsRt.csproj | 4 ++-- ...eJavaScriptEngine.Test.ChakraIeJsRt.csproj | 4 ++-- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 6 ++--- 111 files changed, 149 insertions(+), 161 deletions(-) diff --git a/build/common.props b/build/common.props index 910253f..6bec7b5 100644 --- a/build/common.props +++ b/build/common.props @@ -2,16 +2,4 @@ Copyright © 2012-2021 Andrey Taritsyn - - - $(DefineConstants);NETFULL - - - - $(DefineConstants);NETSTANDARD - - - - $(DefineConstants);NETCOREAPP - \ No newline at end of file diff --git a/global.json b/global.json index 81ef66d..0470208 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.302" + "version": "6.0.100" } } diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs index 88faecf..fc0fd68 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.ScriptSiteBase.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.ScriptSiteBase.cs index 2bf1273..ef2011a 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.ScriptSiteBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.ScriptSiteBase.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Collections.Generic; using System.Globalization; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs index 598de49..54661bb 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Collections.Generic; using System.Globalization; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs index 32c4c5f..f455f67 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Collections.Generic; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs index dd71501..0bf3a3e 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using EXCEPINFO = System.Runtime.InteropServices.ComTypes.EXCEPINFO; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs index d9955cb..a360bdf 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using EXCEPINFO = System.Runtime.InteropServices.ComTypes.EXCEPINFO; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs index 05d9c24..2db2dd5 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.ScriptSite.cs b/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.ScriptSite.cs index bcb8fb3..7a4fcb3 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.ScriptSite.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.ScriptSite.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using MsieJavaScriptEngine.Constants; using MsieJavaScriptEngine.Helpers; using MsieJavaScriptEngine.Resources; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs b/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs index ea885e9..c9bbf35 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Collections.Generic; using MsieJavaScriptEngine.Constants; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.ScriptSite.cs b/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.ScriptSite.cs index acf5ef4..f23b32a 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.ScriptSite.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.ScriptSite.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Collections.Generic; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs b/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs index b268bbb..be28650 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Collections.Generic; using MsieJavaScriptEngine.Constants; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/AppBreakFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/AppBreakFlags.cs index e30918b..f18226d 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/AppBreakFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/AppBreakFlags.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakReason.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakReason.cs index 013b0e7..e632c22 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakReason.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakReason.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakResumeAction.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakResumeAction.cs index 44250fa..67ba243 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakResumeAction.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakResumeAction.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakpointState.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakpointState.cs index 42d4959..71824dd 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakpointState.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/BreakpointState.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs index 88c499f..16cdea9 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocument.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocument.cs index 7f05635..e44333e 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocument.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocument.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Collections.Generic; using System.Linq; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocumentContext.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocumentContext.cs index 074f684..832ced4 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocumentContext.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugDocumentContext.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugLineInfo.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugLineInfo.cs index 241f1a4..7300bde 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugLineInfo.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugLineInfo.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs index 1a7ad39..d5df6d2 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DocumentNameType.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DocumentNameType.cs index f5c8715..9353c03 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DocumentNameType.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DocumentNameType.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/ErrorResumeAction.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/ErrorResumeAction.cs index 6931d88..c294997 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/ErrorResumeAction.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/ErrorResumeAction.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs index 25bddc8..e915cfe 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs index 39cbcd4..8ee47fc 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptErrorDebug.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptErrorDebug.cs index e36b044..6932036 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptErrorDebug.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptErrorDebug.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; using EXCEPINFO = System.Runtime.InteropServices.ComTypes.EXCEPINFO; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs index 2cb9b82..bf43783 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug64.cs index c72eff4..0cec490 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug64.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebugEx.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebugEx.cs index 4de0efe..b44c9fd 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebugEx.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebugEx.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IApplicationDebugger.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IApplicationDebugger.cs index 48d0336..e72e43d 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IApplicationDebugger.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IApplicationDebugger.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs index 6f688c4..6f11a2b 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs @@ -11,7 +11,7 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IDebugApplication32 // : IRemoteDebugApplication { -#if !NETSTANDARD +#if NETFRAMEWORK #region IRemoteDebugApplication methods /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs index c99d263..036edc0 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs @@ -11,7 +11,7 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IDebugApplication64 // : IRemoteDebugApplication { -#if !NETSTANDARD +#if NETFRAMEWORK #region IRemoteDebugApplication methods /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationNode.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationNode.cs index fd6799e..0b892ae 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationNode.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationNode.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationThread.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationThread.cs index bf601fe..c8fc7de 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationThread.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplicationThread.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugAsyncOperation.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugAsyncOperation.cs index 769b129..68cfd16 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugAsyncOperation.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugAsyncOperation.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugCodeContext.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugCodeContext.cs index cf56785..18e0c86 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugCodeContext.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugCodeContext.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocument.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocument.cs index c5a3509..e70f7f4 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocument.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocument.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentContext.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentContext.cs index cf6b76c..3fe7cc1 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentContext.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentContext.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentInfo.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentInfo.cs index 7be288a..488e9ea 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentInfo.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentInfo.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentProvider.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentProvider.cs index ab663e5..c749b6a 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentProvider.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentProvider.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs index ce96b55..c652344 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugProperty.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugProperty.cs index 9004d41..7e8df16 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugProperty.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugProperty.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs index b515d8e..6e65835 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSniffer.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSniffer.cs index e0cfc15..e107105 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSniffer.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSniffer.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx32.cs index 71f1db1..8c301ab 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx32.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx64.cs index a6c83f7..3aa6d91 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrameSnifferEx64.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugSyncOperation.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugSyncOperation.cs index 1cc92d7..64c872f 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugSyncOperation.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugSyncOperation.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs index ef392d7..642367b 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs index 53bbf75..8c63485 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugApplicationNodes.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugApplicationNodes.cs index cc41adf..7c311fe 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugApplicationNodes.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugApplicationNodes.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugCodeContexts.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugCodeContexts.cs index d3753f5..93bb198 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugCodeContexts.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugCodeContexts.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs index e698d46..00f7d49 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugStackFrames.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugStackFrames.cs index d426411..6c75645 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugStackFrames.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugStackFrames.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumRemoteDebugApplicationThreads.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumRemoteDebugApplicationThreads.cs index 020c2c6..e4121a9 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumRemoteDebugApplicationThreads.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumRemoteDebugApplicationThreads.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IProvideExpressionContexts.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IProvideExpressionContexts.cs index 258411b..de68303 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IProvideExpressionContexts.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IProvideExpressionContexts.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IRemoteDebugApplicationThread.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IRemoteDebugApplicationThread.cs index 33aa2a5..0cd3e26 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IRemoteDebugApplicationThread.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IRemoteDebugApplicationThread.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/NullEnumDebugStackFrames.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/NullEnumDebugStackFrames.cs index 2735f83..5cb29a8 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/NullEnumDebugStackFrames.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/NullEnumDebugStackFrames.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs index c18cadb..3cd1459 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using MsieJavaScriptEngine.Helpers; using MsieJavaScriptEngine.Utilities; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs index 407bf59..b86ee0a 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/TextDocAttrs.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/TextDocAttrs.cs index 0cad8a1..a402865 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/TextDocAttrs.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/TextDocAttrs.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript.Debugging diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs index ae0eed4..cdee6c9 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs index 3e4d6c4..e009f67 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; using EXCEPINFO = System.Runtime.InteropServices.ComTypes.EXCEPINFO; diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptGarbageCollector.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptGarbageCollector.cs index b58eeff..937e164 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptGarbageCollector.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptGarbageCollector.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs index 2d0360f..b89d570 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs index 2fa9bc3..d4342a1 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs index f590a3e..5c373ff 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs index d59bddd..0bf8302 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs index c195f10..c8c7c96 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System.Runtime.InteropServices; namespace MsieJavaScriptEngine.ActiveScript diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs index 4a44316..afe457f 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices.ComTypes; diff --git a/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs b/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs index d65a18f..ce14c46 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs b/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs index 7cf568d..40501e3 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptGCType.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptGCType.cs index 5928dfc..49f816a 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptGCType.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptGCType.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs index bb97eea..97d07e8 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptInterruptFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptInterruptFlags.cs index c653693..04d4bb9 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptInterruptFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptInterruptFlags.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs index 5fe126f..5b9958a 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptLanguageVersion.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptLanguageVersion.cs index 95d6cba..d4c90ca 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptLanguageVersion.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptLanguageVersion.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs index c274650..0bab796 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs index 3e1a775..da2b0ba 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs index 7f24c62..3b43870 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadId.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadId.cs index 23bb700..541f3ff 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadId.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadId.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadState.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadState.cs index 1567e9d..bcafbb9 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadState.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptThreadState.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.ActiveScript { /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptTypeLibFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptTypeLibFlags.cs index ef91fcc..ba20786 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptTypeLibFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptTypeLibFlags.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; namespace MsieJavaScriptEngine.ActiveScript diff --git a/src/MsieJavaScriptEngine/Constants/ClassId.cs b/src/MsieJavaScriptEngine/Constants/ClassId.cs index 535df64..715c435 100644 --- a/src/MsieJavaScriptEngine/Constants/ClassId.cs +++ b/src/MsieJavaScriptEngine/Constants/ClassId.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.Constants { /// diff --git a/src/MsieJavaScriptEngine/Constants/ComErrorCode.cs b/src/MsieJavaScriptEngine/Constants/ComErrorCode.cs index 624c09f..26b1222 100644 --- a/src/MsieJavaScriptEngine/Constants/ComErrorCode.cs +++ b/src/MsieJavaScriptEngine/Constants/ComErrorCode.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.Constants { /// diff --git a/src/MsieJavaScriptEngine/Constants/SpecialMemberName.cs b/src/MsieJavaScriptEngine/Constants/SpecialMemberName.cs index 4834591..9febe74 100644 --- a/src/MsieJavaScriptEngine/Constants/SpecialMemberName.cs +++ b/src/MsieJavaScriptEngine/Constants/SpecialMemberName.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK namespace MsieJavaScriptEngine.Constants { /// diff --git a/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs index f023354..0168559 100644 --- a/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Runtime.InteropServices; diff --git a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs index 344af4e..c51cabd 100644 --- a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs @@ -1,10 +1,10 @@ using System; -#if NETSTANDARD +#if !NETFRAMEWORK using System.Collections.Generic; using System.Linq; #endif using System.Reflection; -#if NETSTANDARD +#if !NETFRAMEWORK using MsieJavaScriptEngine.Utilities; #endif @@ -44,7 +44,7 @@ public static bool IsFullyFledgedMethod(MethodInfo method) return isFullyFledged; } -#if !NETSTANDARD +#if NETFRAMEWORK public static MethodInfo[] GetFullyFledgedMethods(MethodInfo[] methods) { diff --git a/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs b/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs index f5baeca..e37a7e8 100644 --- a/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Linq; diff --git a/src/MsieJavaScriptEngine/HostItemBase.cs b/src/MsieJavaScriptEngine/HostItemBase.cs index 55bd380..2528ff0 100644 --- a/src/MsieJavaScriptEngine/HostItemBase.cs +++ b/src/MsieJavaScriptEngine/HostItemBase.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Globalization; using System.Reflection; diff --git a/src/MsieJavaScriptEngine/HostObject.cs b/src/MsieJavaScriptEngine/HostObject.cs index 405f0ad..6895a86 100644 --- a/src/MsieJavaScriptEngine/HostObject.cs +++ b/src/MsieJavaScriptEngine/HostObject.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Globalization; using System.Linq; diff --git a/src/MsieJavaScriptEngine/HostType.cs b/src/MsieJavaScriptEngine/HostType.cs index 5b02a50..aa258c4 100644 --- a/src/MsieJavaScriptEngine/HostType.cs +++ b/src/MsieJavaScriptEngine/HostType.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD +#if NETFRAMEWORK using System; using System.Globalization; using System.Linq; diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs index 2f819a2..800d4b1 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs @@ -304,7 +304,7 @@ public static EdgeJsValue FromString(string value) return reference; } -#if !NETSTANDARD +#if NETFRAMEWORK /// /// Creates a JavaScript value that is a projection of the passed in object @@ -611,7 +611,7 @@ public int ToInt32() return Marshal.PtrToStringUni(buffer, (int)length); } -#if !NETSTANDARD +#if NETFRAMEWORK /// /// Retrieves a object representation of an Object value diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs index e173780..482d292 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs @@ -148,7 +148,7 @@ internal static extern JsErrorCode JsSetRuntimeBeforeCollectCallback(EdgeJsRunti [DllImport(DllName.Chakra)] internal static extern JsErrorCode JsConvertValueToString(EdgeJsValue value, out EdgeJsValue stringValue); -#if !NETSTANDARD +#if NETFRAMEWORK [DllImport(DllName.Chakra)] internal static extern JsErrorCode JsVariantToValue([MarshalAs(UnmanagedType.Struct)] ref object var, diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs index 6d28538..c6fd0ab 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs @@ -1,5 +1,5 @@ using System; -#if NETSTANDARD +#if !NETFRAMEWORK using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -9,14 +9,14 @@ using MsieJavaScriptEngine.Extensions; using MsieJavaScriptEngine.Helpers; -#if NETSTANDARD +#if !NETFRAMEWORK using MsieJavaScriptEngine.JsRt.Embedding; using MsieJavaScriptEngine.Resources; #endif -#if !NETSTANDARD +#if NETFRAMEWORK using MsieJavaScriptEngine.Utilities; #endif -#if NETSTANDARD +#if !NETFRAMEWORK using WrapperException = MsieJavaScriptEngine.JsException; using WrapperRuntimeException = MsieJavaScriptEngine.JsRuntimeException; @@ -25,7 +25,7 @@ namespace MsieJavaScriptEngine.JsRt.Edge { -#if NETSTANDARD +#if !NETFRAMEWORK using EdgeEmbeddedItem = EmbeddedItem; using EdgeEmbeddedObject = EmbeddedObject; using EdgeEmbeddedType = EmbeddedType; @@ -40,13 +40,13 @@ internal sealed class EdgeTypeMapper : TypeMapper public EdgeTypeMapper() -#if !NETSTANDARD +#if NETFRAMEWORK : base(JsEngineMode.ChakraEdgeJsRt) #endif { } -#if !NETSTANDARD +#if NETFRAMEWORK /// /// Creates a JavaScript value from an host object if the it does not already exist /// @@ -148,7 +148,7 @@ public override object MapToHostType(EdgeJsValue value) case JsValueType.String: result = value.ToString(); break; -#if NETSTANDARD +#if !NETFRAMEWORK case JsValueType.Function: EdgeJsPropertyId externalObjectPropertyId = EdgeJsPropertyId.FromString(ExternalObjectPropertyName); if (value.HasProperty(externalObjectPropertyId)) @@ -162,12 +162,12 @@ public override object MapToHostType(EdgeJsValue value) break; #endif case JsValueType.Object: -#if !NETSTANDARD +#if NETFRAMEWORK case JsValueType.Function: #endif case JsValueType.Error: case JsValueType.Array: -#if NETSTANDARD +#if !NETFRAMEWORK result = value.HasExternalData ? GCHandle.FromIntPtr(value.ExternalData).Target : value.ConvertToObject(); #else @@ -184,7 +184,7 @@ public override object MapToHostType(EdgeJsValue value) return result; } -#if NETSTANDARD +#if !NETFRAMEWORK protected override EdgeEmbeddedObject CreateEmbeddedObjectOrFunction(object obj) { diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs index 71c8699..1a109a4 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs @@ -1,4 +1,4 @@ -#if NETSTANDARD +#if !NETFRAMEWORK using System; using System.Collections.Generic; diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs index ee0bf5a..1902505 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs @@ -1,4 +1,4 @@ -#if NETSTANDARD +#if !NETFRAMEWORK using System; using System.Collections.Generic; diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs index 9eb2009..bc18574 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs @@ -1,4 +1,4 @@ -#if NETSTANDARD +#if !NETFRAMEWORK using System; using System.Collections; using System.Collections.Generic; diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs index f29a1c1..680ad70 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs @@ -1,4 +1,4 @@ -#if NETSTANDARD +#if !NETFRAMEWORK using System; using System.Collections.Generic; diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs index d429422..1113218 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs @@ -305,7 +305,7 @@ public static IeJsValue FromString(string value) return reference; } -#if !NETSTANDARD +#if NETFRAMEWORK /// /// Creates a JavaScript value that is a projection of the passed in object @@ -611,7 +611,7 @@ public int ToInt32() return Marshal.PtrToStringUni(buffer, (int)length); } -#if !NETSTANDARD +#if NETFRAMEWORK /// /// Retrieves a object representation of an Object value diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs index 14a6f9d..5529a2a 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs @@ -154,7 +154,7 @@ internal static extern JsErrorCode JsCreateContext(IeJsRuntime runtime, IDebugAp [DllImport(DllName.JScript9)] internal static extern JsErrorCode JsConvertValueToString(IeJsValue value, out IeJsValue stringValue); -#if !NETSTANDARD +#if NETFRAMEWORK [DllImport(DllName.JScript9)] internal static extern JsErrorCode JsVariantToValue([MarshalAs(UnmanagedType.Struct)] ref object var, diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs index 00256a0..a0c7ebd 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs @@ -1,5 +1,5 @@ using System; -#if NETSTANDARD +#if !NETFRAMEWORK using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -9,7 +9,7 @@ using MsieJavaScriptEngine.Extensions; using MsieJavaScriptEngine.Helpers; -#if NETSTANDARD +#if !NETFRAMEWORK using MsieJavaScriptEngine.JsRt.Embedding; using MsieJavaScriptEngine.Resources; @@ -20,7 +20,7 @@ namespace MsieJavaScriptEngine.JsRt.Ie { -#if NETSTANDARD +#if !NETFRAMEWORK using IeEmbeddedItem = EmbeddedItem; using IeEmbeddedObject = EmbeddedObject; using IeEmbeddedType = EmbeddedType; @@ -35,13 +35,13 @@ internal sealed class IeTypeMapper : TypeMapper /// Constructs an instance of the “IE” type mapper /// public IeTypeMapper() -#if !NETSTANDARD +#if NETFRAMEWORK : base(JsEngineMode.ChakraIeJsRt) #endif { } -#if !NETSTANDARD +#if NETFRAMEWORK /// /// Creates a JavaScript value from an host object if the it does not already exist /// @@ -143,7 +143,7 @@ public override object MapToHostType(IeJsValue value) case JsValueType.String: result = value.ToString(); break; -#if NETSTANDARD +#if !NETFRAMEWORK case JsValueType.Function: IeJsPropertyId externalObjectPropertyId = IeJsPropertyId.FromString(ExternalObjectPropertyName); if (value.HasProperty(externalObjectPropertyId)) @@ -157,12 +157,12 @@ public override object MapToHostType(IeJsValue value) break; #endif case JsValueType.Object: -#if !NETSTANDARD +#if NETFRAMEWORK case JsValueType.Function: #endif case JsValueType.Error: case JsValueType.Array: -#if NETSTANDARD +#if !NETFRAMEWORK result = value.HasExternalData ? GCHandle.FromIntPtr(value.ExternalData).Target : value.ConvertToObject(); #else @@ -179,7 +179,7 @@ public override object MapToHostType(IeJsValue value) return result; } -#if NETSTANDARD +#if !NETFRAMEWORK protected override IeEmbeddedObject CreateEmbeddedObjectOrFunction(object obj) { diff --git a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs index 4297893..25ecc08 100644 --- a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs @@ -1,14 +1,14 @@ using System; -#if NETSTANDARD +#if !NETFRAMEWORK using System.Collections.Concurrent; #endif using System.Linq; -#if NETSTANDARD +#if !NETFRAMEWORK using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #endif -#if NETSTANDARD +#if !NETFRAMEWORK using MsieJavaScriptEngine.JsRt.Embedding; using MsieJavaScriptEngine.Utilities; @@ -25,7 +25,7 @@ internal abstract class TypeMapper : IDisposable where TValue : struct where TFunction : Delegate { -#if NETSTANDARD +#if !NETFRAMEWORK /// /// Name of property to store the external object /// @@ -98,7 +98,7 @@ protected TypeMapper(JsEngineMode engineMode) /// /// Instance of host type /// JavaScript value created from an host object -#if NETSTANDARD +#if !NETFRAMEWORK public virtual TValue GetOrCreateScriptObject(object obj) { @@ -134,7 +134,7 @@ public virtual TValue GetOrCreateScriptObject(object obj) /// /// Host type /// JavaScript value created from an host type -#if NETSTANDARD +#if !NETFRAMEWORK public virtual TValue GetOrCreateScriptType(Type type) { if (!_embeddedTypeStorageInitialized) @@ -177,7 +177,7 @@ public virtual TValue GetOrCreateScriptType(Type type) /// The source value /// The mapped value public abstract object MapToHostType(TValue value); -#if NETSTANDARD +#if !NETFRAMEWORK protected abstract EmbeddedObject CreateEmbeddedObjectOrFunction(object obj); @@ -291,7 +291,7 @@ protected static Exception UnwrapException(Exception exception) /// public virtual void Dispose() { -#if NETSTANDARD +#if !NETFRAMEWORK if (_disposedFlag.Set()) { var lazyEmbeddedObjects = _lazyEmbeddedObjects; diff --git a/src/MsieJavaScriptEngine/MsieJsEngine.cs b/src/MsieJavaScriptEngine/MsieJsEngine.cs index f93a473..206b5b1 100644 --- a/src/MsieJavaScriptEngine/MsieJsEngine.cs +++ b/src/MsieJavaScriptEngine/MsieJsEngine.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; using System.Text; -#if !NETSTANDARD +#if NETFRAMEWORK using MsieJavaScriptEngine.ActiveScript; #endif using MsieJavaScriptEngine.Helpers; @@ -93,7 +93,7 @@ public MsieJsEngine(JsEngineSettings settings) { processedEngineMode = JsEngineMode.ChakraIeJsRt; } -#if !NETSTANDARD +#if NETFRAMEWORK else if (ChakraActiveScriptJsEngine.IsSupported()) { processedEngineMode = JsEngineMode.ChakraActiveScript; @@ -106,7 +106,7 @@ public MsieJsEngine(JsEngineSettings settings) else { throw new JsEngineLoadException( -#if NETSTANDARD +#if !NETFRAMEWORK NetCoreStrings.Engine_JsEnginesNotFound #else NetFrameworkStrings.Engine_JsEnginesNotFound @@ -173,7 +173,7 @@ public MsieJsEngine(JsEngineSettings settings) break; case JsEngineMode.ChakraActiveScript: -#if !NETSTANDARD +#if NETFRAMEWORK if (previousMode != JsEngineMode.ChakraEdgeJsRt) { @@ -196,7 +196,7 @@ public MsieJsEngine(JsEngineSettings settings) string.Format(NetCoreStrings.Usage_JsEngineModeNotCompatibleWithNetCore, processedEngineMode)); #endif case JsEngineMode.Classic: -#if !NETSTANDARD +#if NETFRAMEWORK _jsEngine = new ClassicActiveScriptJsEngine(processedSettings); break; diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index 4b344cd..2a38092 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Benchmarks 3.0.8 - net461;netcoreapp2.1;netcoreapp3.1;net5.0 + net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Exe true false @@ -12,7 +12,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 8f56204..c31cadc 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Auto Mode 3.0.8 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true true @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index d0be18d..ae0899d 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 2689d86..a0122f6 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode 3.0.8 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true true @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index 7432557..a573ce2 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode 3.0.8 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true true @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index 4900563..278d70d 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 6cbda00..dc8382d 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Common Tests 3.0.8 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true true @@ -14,9 +14,9 @@ - + - + From 0641103e7a0aafaf0c6586c500b22107966b2191 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Wed, 20 Jul 2022 20:23:20 +0300 Subject: [PATCH 02/28] Now a case-sensitive cultural postfixes are used in the names of `.resx` files. --- global.json | 2 +- src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 2 +- ...gs.ru-ru.Designer.cs => CommonStrings.ru-RU.Designer.cs} | 0 .../{CommonStrings.ru-ru.resx => CommonStrings.ru-RU.resx} | 0 src/MsieJavaScriptEngine/readme.txt | 2 +- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraActiveScript.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 6 +++--- 11 files changed, 11 insertions(+), 11 deletions(-) rename src/MsieJavaScriptEngine/Resources/{CommonStrings.ru-ru.Designer.cs => CommonStrings.ru-RU.Designer.cs} (100%) rename src/MsieJavaScriptEngine/Resources/{CommonStrings.ru-ru.resx => CommonStrings.ru-RU.resx} (100%) diff --git a/global.json b/global.json index 0470208..b1927b6 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.100" + "version": "6.0.302" } } diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index e5b0d4e..60bbe63 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - Improved a implementation of the `Dispose` method. + Now a case-sensitive cultural postfixes are used in the names of `.resx` files. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-ru.Designer.cs b/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.Designer.cs similarity index 100% rename from src/MsieJavaScriptEngine/Resources/CommonStrings.ru-ru.Designer.cs rename to src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.Designer.cs diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-ru.resx b/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.resx similarity index 100% rename from src/MsieJavaScriptEngine/Resources/CommonStrings.ru-ru.resx rename to src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.resx diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index ef50405..80425a7 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,7 +21,7 @@ ============= RELEASE NOTES ============= - Improved a implementation of the `Dispose` method. + Now a case-sensitive cultural postfixes are used in the names of `.resx` files. ============ PROJECT SITE diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index c31cadc..1dbf26e 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index ae0899d..c6a3f62 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index a0122f6..9985f94 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index a573ce2..fb64d69 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index 278d70d..9910c1d 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index dc8382d..37108ac 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -14,9 +14,9 @@ - - - + + + From eac1f2eec2a73b5591bee245e723ac84740c6e2b Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Wed, 20 Jul 2022 20:50:50 +0300 Subject: [PATCH 03/28] Version 3.0.9 --- CHANGELOG.md | 3 +++ LICENSE.txt | 2 +- build/common.props | 2 +- src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/readme.txt | 4 ++-- .../MsieJavaScriptEngine.Benchmarks.csproj | 2 +- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraActiveScript.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 2 +- 12 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2474aa..1cdc77c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Change log ========== +## v3.0.9 - July 20, 2022 + * Now a case-sensitive cultural postfixes are used in the names of `.resx` files + ## v3.0.8 - August 8, 2021 * Improved a implementation of the `Dispose` method diff --git a/LICENSE.txt b/LICENSE.txt index 15d3451..1b36598 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ - Copyright (c) 2012-2021 Andrey Taritsyn - http://www.taritsyn.ru + Copyright (c) 2012-2022 Andrey Taritsyn - http://www.taritsyn.ru Apache License Version 2.0, January 2004 diff --git a/build/common.props b/build/common.props index 6bec7b5..d5c9126 100644 --- a/build/common.props +++ b/build/common.props @@ -1,5 +1,5 @@ - Copyright © 2012-2021 Andrey Taritsyn + Copyright © 2012-2022 Andrey Taritsyn \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 60bbe63..41be737 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine for .NET - 3.0.8 + 3.0.9 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 7.3 diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 80425a7..cc7c084 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,11 +1,11 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.0.8 + README file for MSIE JavaScript Engine for .NET v3.0.9 -------------------------------------------------------------------------------- - Copyright (c) 2012-2021 Andrey Taritsyn - http://www.taritsyn.ru + Copyright (c) 2012-2022 Andrey Taritsyn - http://www.taritsyn.ru =========== diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index 2a38092..1aac48a 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Benchmarks - 3.0.8 + 3.0.9 net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Exe true diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 1dbf26e..317e66d 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.0.8 + 3.0.9 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index c6a3f62..d9e4e79 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.0.8 + 3.0.9 net40;net45 Library true diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 9985f94..3ef9c86 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.0.8 + 3.0.9 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index fb64d69..cb0695e 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.0.8 + 3.0.9 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index 9910c1d..f52c8c2 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.0.8 + 3.0.9 net40;net45 Library true diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 37108ac..e975c23 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Common Tests - 3.0.8 + 3.0.9 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 Library true From 1d02b1d03f872a2786ace5e0841d5b424ee19d8a Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Wed, 1 Feb 2023 20:17:39 +0300 Subject: [PATCH 04/28] In test projects added support of .NET 7 --- global.json | 2 +- .../MsieJavaScriptEngine.Benchmarks.csproj | 10 ++++++++-- .../MsieJavaScriptEngine.Test.Auto.csproj | 4 ++-- ...eJavaScriptEngine.Test.ChakraActiveScript.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 4 ++-- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 4 ++-- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 13 ++++++++++--- 8 files changed, 27 insertions(+), 14 deletions(-) diff --git a/global.json b/global.json index b1927b6..9b92080 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.302" + "version": "7.0.102" } } diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index 1aac48a..af6ac85 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Benchmarks 3.0.9 - net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 + net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Exe true false @@ -12,9 +12,15 @@ + + + + + - + + diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 317e66d..6e1f695 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Auto Mode 3.0.9 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true true @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index d9e4e79..c5f970f 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 3ef9c86..39c76fd 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode 3.0.9 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true true @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index cb0695e..8fcf9b5 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode 3.0.9 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true true @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index f52c8c2..d3a58ce 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index e975c23..e06979a 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Common Tests 3.0.9 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 + net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true true @@ -14,13 +14,20 @@ - + - + + + + + + + + From c87e8a7e06aa9c1ecd44cd7f7ffeca4fe68cfd01 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Wed, 1 Feb 2023 20:40:37 +0300 Subject: [PATCH 05/28] Suppressed a build warning `NETSSDK1138` --- .../MsieJavaScriptEngine.Benchmarks.csproj | 1 + .../MsieJavaScriptEngine.Test.Auto.csproj | 1 + .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 1 + .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 1 + .../MsieJavaScriptEngine.Test.Common.csproj | 1 + 5 files changed, 5 insertions(+) diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index af6ac85..86c8be2 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -7,6 +7,7 @@ Exe true false + false diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 6e1f695..18f1911 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -8,6 +8,7 @@ true true false + false diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 39c76fd..f15fed9 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -8,6 +8,7 @@ true true false + false diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index 8fcf9b5..dea7979 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -8,6 +8,7 @@ true true false + false diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index e06979a..85710b4 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -8,6 +8,7 @@ true true false + false From bf3a8c3aa4415aab32fa88c6e0992ebbf0f85fa2 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Thu, 2 Feb 2023 19:23:00 +0300 Subject: [PATCH 06/28] Simplified a names of tests --- .../CommonTests.cs | 18 ++--- .../InteropTests.cs | 2 +- .../CommonTests.cs | 18 ++--- .../InteropTests.cs | 2 +- .../PrecompilationTests.cs | 8 +- .../CommonTests.cs | 18 ++--- .../InteropTests.cs | 2 +- .../PrecompilationTests.cs | 8 +- .../CommonTests.cs | 18 ++--- .../Es5Tests.cs | 2 +- .../InteropTests.cs | 2 +- .../CommonTestsBase.cs | 78 +++++++++--------- .../ErrorFormattingTests.cs | 2 +- .../Es5TestsBase.cs | 38 ++++----- .../InteropTestsBase.cs | 80 +++++++++---------- .../MultithreadingTestsBase.cs | 2 +- .../PrecompilationTestsBase.cs | 8 +- .../ValidationTests.cs | 8 +- 18 files changed, 157 insertions(+), 157 deletions(-) diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs index e7a0e0d..a3d4893 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs @@ -17,7 +17,7 @@ public class CommonTests : CommonTestsBase #region Mapping of errors [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -53,7 +53,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() { // Arrange const string input = @"var $variable1 = 611; @@ -89,7 +89,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorr } [Test] - public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingRuntimeErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -126,7 +126,7 @@ public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() + public void MappingCompilationErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -168,7 +168,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() } [Test] - public void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCorrect() + public void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() { // Arrange const string input = @"function factorial(value) { @@ -210,7 +210,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCorrect() } [Test] - public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() + public void MappingRuntimeErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -257,7 +257,7 @@ public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() #region Generation of error messages [Test] - public void GenerationOfCompilationErrorMessageIsCorrect() + public void GenerationOfCompilationErrorMessage() { // Arrange const string input = @"var arr = []; @@ -287,7 +287,7 @@ public void GenerationOfCompilationErrorMessageIsCorrect() } [Test] - public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() + public void GenerationOfCompilationErrorMessageInDebugMode() { // Arrange const string input = @"var arr = []; @@ -317,7 +317,7 @@ public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() } [Test] - public void GenerationOfRuntimeErrorMessageIsCorrect() + public void GenerationOfRuntimeErrorMessage() { // Arrange const string input = @"function foo(x, y) { diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs index 27b4b4c..d6c6443 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs @@ -20,7 +20,7 @@ public class InteropTests : InteropTestsBase #region Mapping of errors [Test] - public void MappingRuntimeErrorDuringRecursiveEvaluationOfFilesIsCorrect() + public void MappingRuntimeErrorDuringRecursiveEvaluationOfFiles() { // Arrange string directoryPath = GetAbsolutePath("SharedFiles/recursiveEvaluation/runtimeError"); diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs index 0afc7e8..8549729 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs @@ -18,7 +18,7 @@ public class CommonTests : CommonTestsBase #region Mapping of errors [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -54,7 +54,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() { // Arrange const string input = @"var $variable1 = 611; @@ -90,7 +90,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorr } [Test] - public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingRuntimeErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -127,7 +127,7 @@ public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() + public void MappingCompilationErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -169,7 +169,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() } [Test] - public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCorrect() + public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() { // Arrange const string input = @"function factorial(value) { @@ -211,7 +211,7 @@ public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCor } [Test] - public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() + public void MappingRuntimeErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -262,7 +262,7 @@ public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() #region Generation of error messages [Test] - public void GenerationOfCompilationErrorMessageIsCorrect() + public void GenerationOfCompilationErrorMessage() { // Arrange const string input = @"var arr = []; @@ -292,7 +292,7 @@ public void GenerationOfCompilationErrorMessageIsCorrect() } [Test] - public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() + public void GenerationOfCompilationErrorMessageInDebugMode() { // Arrange const string input = @"var arr = []; @@ -322,7 +322,7 @@ public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() } [Test] - public void GenerationOfRuntimeErrorMessageIsCorrect() + public void GenerationOfRuntimeErrorMessage() { // Arrange const string input = @"function foo(x, y) { diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs index 6cbb8fb..35e22de 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs @@ -46,7 +46,7 @@ public void EmbeddedInstanceOfDelegateHasFunctionPrototype() #region Mapping of errors [Test] - public void MappingRuntimeErrorDuringRecursiveEvaluationOfFilesIsCorrect() + public void MappingRuntimeErrorDuringRecursiveEvaluationOfFiles() { // Arrange string directoryPath = GetAbsolutePath("SharedFiles/recursiveEvaluation/runtimeError"); diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/PrecompilationTests.cs b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/PrecompilationTests.cs index 4d40573..2b0bd53 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/PrecompilationTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/PrecompilationTests.cs @@ -18,7 +18,7 @@ public class PrecompilationTests : PrecompilationTestsBase #region Mapping of errors [Test] - public void MappingCompilationErrorDuringPrecompilationOfCodeIsCorrect() + public void MappingCompilationErrorDuringPrecompilationOfCode() { // Arrange const string input = @"function guid() { @@ -63,7 +63,7 @@ function s4() { } [Test] - public void MappingRuntimeErrorDuringExecutionOfPrecompiledCodeIsCorrect() + public void MappingRuntimeErrorDuringExecutionOfPrecompiledCode() { // Arrange const string input = @"function getItem(items, itemIndex) { @@ -118,7 +118,7 @@ public void MappingRuntimeErrorDuringExecutionOfPrecompiledCodeIsCorrect() #region Generation of error messages [Test] - public void GenerationOfCompilationErrorMessageIsCorrect() + public void GenerationOfCompilationErrorMessage() { // Arrange const string input = @"function makeId(length) { @@ -159,7 +159,7 @@ public void GenerationOfCompilationErrorMessageIsCorrect() } [Test] - public void GenerationOfRuntimeErrorMessageIsCorrect() + public void GenerationOfRuntimeErrorMessage() { // Arrange const string input = @"function getFullName(firstName, lastName) { diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs index 770e9a4..2c34764 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs @@ -17,7 +17,7 @@ public class CommonTests : CommonTestsBase #region Mapping of errors [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -53,7 +53,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() { // Arrange const string input = @"var $variable1 = 611; @@ -89,7 +89,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorr } [Test] - public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingRuntimeErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -126,7 +126,7 @@ public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() + public void MappingCompilationErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -168,7 +168,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() } [Test] - public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCorrect() + public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() { // Arrange const string input = @"function factorial(value) { @@ -210,7 +210,7 @@ public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCor } [Test] - public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() + public void MappingRuntimeErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -261,7 +261,7 @@ public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() #region Generation of error messages [Test] - public void GenerationOfCompilationErrorMessageIsCorrect() + public void GenerationOfCompilationErrorMessage() { // Arrange const string input = @"var arr = []; @@ -291,7 +291,7 @@ public void GenerationOfCompilationErrorMessageIsCorrect() } [Test] - public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() + public void GenerationOfCompilationErrorMessageInDebugMode() { // Arrange const string input = @"var arr = []; @@ -321,7 +321,7 @@ public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() } [Test] - public void GenerationOfRuntimeErrorMessageIsCorrect() + public void GenerationOfRuntimeErrorMessage() { // Arrange const string input = @"function foo(x, y) { diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs index e55b5e6..c4cf210 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs @@ -46,7 +46,7 @@ public void EmbeddedInstanceOfDelegateHasFunctionPrototype() #region Mapping of errors [Test] - public void MappingRuntimeErrorDuringRecursiveEvaluationOfFilesIsCorrect() + public void MappingRuntimeErrorDuringRecursiveEvaluationOfFiles() { // Arrange string directoryPath = GetAbsolutePath("SharedFiles/recursiveEvaluation/runtimeError"); diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/PrecompilationTests.cs b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/PrecompilationTests.cs index 5b9cdc4..b9f9b7c 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/PrecompilationTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/PrecompilationTests.cs @@ -17,7 +17,7 @@ public class PrecompilationTests : PrecompilationTestsBase #region Mapping of errors [Test] - public void MappingCompilationErrorDuringPrecompilationOfCodeIsCorrect() + public void MappingCompilationErrorDuringPrecompilationOfCode() { // Arrange const string input = @"function guid() { @@ -62,7 +62,7 @@ function s4() { } [Test] - public void MappingRuntimeErrorDuringExecutionOfPrecompiledCodeIsCorrect() + public void MappingRuntimeErrorDuringExecutionOfPrecompiledCode() { // Arrange const string input = @"function getItem(items, itemIndex) { @@ -117,7 +117,7 @@ public void MappingRuntimeErrorDuringExecutionOfPrecompiledCodeIsCorrect() #region Generation of error messages [Test] - public void GenerationOfCompilationErrorMessageIsCorrect() + public void GenerationOfCompilationErrorMessage() { // Arrange const string input = @"function makeId(length) { @@ -158,7 +158,7 @@ public void GenerationOfCompilationErrorMessageIsCorrect() } [Test] - public void GenerationOfRuntimeErrorMessageIsCorrect() + public void GenerationOfRuntimeErrorMessage() { // Arrange const string input = @"function getFullName(firstName, lastName) { diff --git a/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs b/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs index f070a05..43b314c 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs @@ -17,7 +17,7 @@ public class CommonTests : CommonTestsBase #region Mapping of errors [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -53,7 +53,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorrect() + public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() { // Arrange const string input = @"var $variable1 = 611; @@ -89,7 +89,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugModeIsCorr } [Test] - public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() + public void MappingRuntimeErrorDuringEvaluationOfExpression() { // Arrange const string input = @"var $variable1 = 611; @@ -126,7 +126,7 @@ public void MappingRuntimeErrorDuringEvaluationOfExpressionIsCorrect() } [Test] - public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() + public void MappingCompilationErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -168,7 +168,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeIsCorrect() } [Test] - public void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCorrect() + public void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() { // Arrange const string input = @"function factorial(value) { @@ -210,7 +210,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeInDebugModeIsCorrect() } [Test] - public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() + public void MappingRuntimeErrorDuringExecutionOfCode() { // Arrange const string input = @"function factorial(value) { @@ -257,7 +257,7 @@ public void MappingRuntimeErrorDuringExecutionOfCodeIsCorrect() #region Generation of error messages [Test] - public void GenerationOfCompilationErrorMessageIsCorrect() + public void GenerationOfCompilationErrorMessage() { // Arrange const string input = @"var arr = []; @@ -287,7 +287,7 @@ public void GenerationOfCompilationErrorMessageIsCorrect() } [Test] - public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() + public void GenerationOfCompilationErrorMessageInDebugMode() { // Arrange const string input = @"var arr = []; @@ -317,7 +317,7 @@ public void GenerationOfCompilationErrorMessageInDebugModeIsCorrect() } [Test] - public void GenerationOfRuntimeErrorMessageIsCorrect() + public void GenerationOfRuntimeErrorMessage() { // Arrange const string input = @"function foo(x, y) { diff --git a/test/MsieJavaScriptEngine.Test.Classic/Es5Tests.cs b/test/MsieJavaScriptEngine.Test.Classic/Es5Tests.cs index b447707..9ab2544 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/Es5Tests.cs +++ b/test/MsieJavaScriptEngine.Test.Classic/Es5Tests.cs @@ -15,7 +15,7 @@ public class Es5Tests : Es5TestsBase #region Object methods [Test] - public override void ObjectKeysMethodIsSupported() + public override void SupportsObjectKeysMethod() { // Arrange const string input1 = "Object.keys(['a', 'b', 'c']).toString();"; diff --git a/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs b/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs index 23997cc..41d91a0 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs @@ -20,7 +20,7 @@ public class InteropTests : InteropTestsBase #region Mapping of errors [Test] - public void MappingRuntimeErrorDuringRecursiveEvaluationOfFilesIsCorrect() + public void MappingRuntimeErrorDuringRecursiveEvaluationOfFiles() { // Arrange string directoryPath = GetAbsolutePath("SharedFiles/recursiveEvaluation/runtimeError"); diff --git a/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs index 71485fc..666be5f 100644 --- a/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs @@ -15,7 +15,7 @@ public abstract class CommonTestsBase : FileSystemTestsBase #region Creation of engines [Test] - public virtual void CreationOfEngineWithoutDisposingIsCorrect() + public virtual void CreationOfEngineWithoutDisposing() { MsieJsEngine jsEngine = CreateJsEngine(); jsEngine.Execute("var a = 1 + 1;"); @@ -26,7 +26,7 @@ public virtual void CreationOfEngineWithoutDisposingIsCorrect() #region Evaluation of scripts [Test] - public virtual void EvaluationOfExpressionWithUndefinedResultIsCorrect() + public virtual void EvaluationOfExpressionWithUndefinedResult() { // Arrange const string input = "undefined"; @@ -45,7 +45,7 @@ public virtual void EvaluationOfExpressionWithUndefinedResultIsCorrect() } [Test] - public virtual void EvaluationOfExpressionWithNullResultIsCorrect() + public virtual void EvaluationOfExpressionWithNullResult() { // Arrange const string input = "null"; @@ -64,7 +64,7 @@ public virtual void EvaluationOfExpressionWithNullResultIsCorrect() } [Test] - public virtual void EvaluationOfExpressionWithBooleanResultIsCorrect() + public virtual void EvaluationOfExpressionWithBooleanResult() { // Arrange const string input1 = "7 > 5"; @@ -89,7 +89,7 @@ public virtual void EvaluationOfExpressionWithBooleanResultIsCorrect() } [Test] - public virtual void EvaluationOfExpressionWithIntegerResultIsCorrect() + public virtual void EvaluationOfExpressionWithIntegerResult() { // Arrange const string input = "7 * 8 - 20"; @@ -108,7 +108,7 @@ public virtual void EvaluationOfExpressionWithIntegerResultIsCorrect() } [Test] - public virtual void EvaluationOfExpressionWithDoubleResultIsCorrect() + public virtual void EvaluationOfExpressionWithDoubleResult() { // Arrange const string input = "Math.PI + 0.22"; @@ -127,7 +127,7 @@ public virtual void EvaluationOfExpressionWithDoubleResultIsCorrect() } [Test] - public virtual void EvaluationOfExpressionWithStringResultIsCorrect() + public virtual void EvaluationOfExpressionWithStringResult() { // Arrange const string input = "'Hello, ' + \"Vasya\" + '?';"; @@ -146,7 +146,7 @@ public virtual void EvaluationOfExpressionWithStringResultIsCorrect() } [Test] - public virtual void EvaluationOfExpressionWithUnicodeStringResultIsCorrect() + public virtual void EvaluationOfExpressionWithUnicodeStringResult() { // Arrange const string input = "'Привет, ' + \"Вася\" + '?';"; @@ -169,7 +169,7 @@ public virtual void EvaluationOfExpressionWithUnicodeStringResultIsCorrect() #region Execution of scripts [Test] - public virtual void ExecutionOfCodeIsCorrect() + public virtual void ExecutionOfCode() { // Arrange const string functionCode = @"function add(num1, num2) { @@ -192,7 +192,7 @@ public virtual void ExecutionOfCodeIsCorrect() } [Test] - public virtual void ExecutionOfFileIsCorrect() + public virtual void ExecutionOfFile() { // Arrange string filePath = GetAbsolutePath("SharedFiles/square.js"); @@ -213,7 +213,7 @@ public virtual void ExecutionOfFileIsCorrect() } [Test] - public virtual void ExecutionOfResourceByNameAndTypeIsCorrect() + public virtual void ExecutionOfResourceByNameAndType() { // Arrange const string resourceName = "Resources.cube.js"; @@ -234,7 +234,7 @@ public virtual void ExecutionOfResourceByNameAndTypeIsCorrect() } [Test] - public virtual void ExecutionOfResourceByNameAndAssemblyIsCorrect() + public virtual void ExecutionOfResourceByNameAndAssembly() { // Arrange const string resourceName = "MsieJavaScriptEngine.Test.Common.Resources.power.js"; @@ -264,7 +264,7 @@ public virtual void ExecutionOfResourceByNameAndAssemblyIsCorrect() #region Calling of functions [Test] - public virtual void CallingOfFunctionWithoutParametersIsCorrect() + public virtual void CallingOfFunctionWithoutParameters() { // Arrange const string functionCode = @"function hooray() { @@ -286,7 +286,7 @@ public virtual void CallingOfFunctionWithoutParametersIsCorrect() } [Test] - public virtual void CallingOfFunctionWithUndefinedResultIsCorrect() + public virtual void CallingOfFunctionWithUndefinedResult() { // Arrange const string functionCode = @"function testUndefined(value) { @@ -312,7 +312,7 @@ public virtual void CallingOfFunctionWithUndefinedResultIsCorrect() } [Test] - public virtual void CallingOfFunctionWithNullResultIsCorrect() + public virtual void CallingOfFunctionWithNullResult() { // Arrange const string functionCode = @"function testNull(value) { @@ -338,7 +338,7 @@ public virtual void CallingOfFunctionWithNullResultIsCorrect() } [Test] - public virtual void CallingOfFunctionWithBooleanResultIsCorrect() + public virtual void CallingOfFunctionWithBooleanResult() { // Arrange const string functionCode = @"function inverse(value) { @@ -361,7 +361,7 @@ public virtual void CallingOfFunctionWithBooleanResultIsCorrect() } [Test] - public virtual void CallingOfFunctionWithIntegerResultIsCorrect() + public virtual void CallingOfFunctionWithIntegerResult() { // Arrange const string functionCode = @"function negate(value) { @@ -384,7 +384,7 @@ public virtual void CallingOfFunctionWithIntegerResultIsCorrect() } [Test] - public virtual void CallingOfFunctionWithDoubleResultIsCorrect() + public virtual void CallingOfFunctionWithDoubleResult() { // Arrange const string functionCode = @"function triple(value) { @@ -407,7 +407,7 @@ public virtual void CallingOfFunctionWithDoubleResultIsCorrect() } [Test] - public virtual void CallingOfFunctionWithStringResultIsCorrect() + public virtual void CallingOfFunctionWithStringResult() { // Arrange const string functionCode = @"function greeting(name) { @@ -430,7 +430,7 @@ public virtual void CallingOfFunctionWithStringResultIsCorrect() } [Test] - public virtual void CallingOfFunctionWithUnicodeStringResultIsCorrect() + public virtual void CallingOfFunctionWithUnicodeStringResult() { // Arrange const string functionCode = @"function privet(name) { @@ -453,7 +453,7 @@ public virtual void CallingOfFunctionWithUnicodeStringResultIsCorrect() } [Test] - public virtual void CallingOfFunctionWithManyParametersIsCorrect() + public virtual void CallingOfFunctionWithManyParameters() { // Arrange const string functionCode = @"function determineArgumentsTypes() { @@ -487,7 +487,7 @@ public virtual void CallingOfFunctionWithManyParametersIsCorrect() } [Test] - public virtual void CallingOfFunctionWithManyParametersAndBooleanResultIsCorrect() + public virtual void CallingOfFunctionWithManyParametersAndBooleanResult() { // Arrange const string functionCode = @"function and() { @@ -525,7 +525,7 @@ public virtual void CallingOfFunctionWithManyParametersAndBooleanResultIsCorrect } [Test] - public virtual void CallingOfFunctionWithManyParametersAndIntegerResultIsCorrect() + public virtual void CallingOfFunctionWithManyParametersAndIntegerResult() { // Arrange const string functionCode = @"function sum() { @@ -555,7 +555,7 @@ public virtual void CallingOfFunctionWithManyParametersAndIntegerResultIsCorrect } [Test] - public virtual void CallingOfFunctionWithManyParametersAndDoubleResultIsCorrect() + public virtual void CallingOfFunctionWithManyParametersAndDoubleResult() { // Arrange const string functionCode = @"function sum() { @@ -585,7 +585,7 @@ public virtual void CallingOfFunctionWithManyParametersAndDoubleResultIsCorrect( } [Test] - public virtual void CallingOfFunctionWithManyParametersAndStringResultIsCorrect() + public virtual void CallingOfFunctionWithManyParametersAndStringResult() { // Arrange const string functionCode = @"function concatenate() { @@ -615,7 +615,7 @@ public virtual void CallingOfFunctionWithManyParametersAndStringResultIsCorrect( } [Test] - public virtual void CallingOfFunctionWithManyParametersAndUnicodeStringResultIsCorrect() + public virtual void CallingOfFunctionWithManyParametersAndUnicodeStringResult() { // Arrange const string functionCode = @"function obedinit() { @@ -645,7 +645,7 @@ public virtual void CallingOfFunctionWithManyParametersAndUnicodeStringResultIsC } [Test] - public virtual void CallingOfFunctionWithNameContainingUnicodeCharactersIsCorrect() + public virtual void CallingOfFunctionWithNameContainingUnicodeCharacters() { // Arrange const string functionCode = @"function сумма(число1, число2) { @@ -672,7 +672,7 @@ public virtual void CallingOfFunctionWithNameContainingUnicodeCharactersIsCorrec #region Getting, setting and removing variables [Test] - public virtual void SettingAndGettingVariableWithUndefinedValueIsCorrect() + public virtual void SettingAndGettingVariableWithUndefinedValue() { // Arrange const string variableName = "myVar1"; @@ -695,7 +695,7 @@ public virtual void SettingAndGettingVariableWithUndefinedValueIsCorrect() } [Test] - public virtual void SettingAndGettingVariableWithNullValueIsCorrect() + public virtual void SettingAndGettingVariableWithNullValue() { // Arrange const string variableName = "myVar2"; @@ -718,7 +718,7 @@ public virtual void SettingAndGettingVariableWithNullValueIsCorrect() } [Test] - public virtual void SettingAndGettingVariableWithBooleanValueIsCorrect() + public virtual void SettingAndGettingVariableWithBooleanValue() { // Arrange const string variableName = "isVisible"; @@ -752,7 +752,7 @@ public virtual void SettingAndGettingVariableWithBooleanValueIsCorrect() } [Test] - public virtual void SettingAndGettingVariableWithIntegerValueIsCorrect() + public virtual void SettingAndGettingVariableWithIntegerValue() { // Arrange const string variableName = "amount"; @@ -786,7 +786,7 @@ public virtual void SettingAndGettingVariableWithIntegerValueIsCorrect() } [Test] - public virtual void SettingAndGettingVariableWithDoubleValueIsCorrect() + public virtual void SettingAndGettingVariableWithDoubleValue() { // Arrange const string variableName = "price"; @@ -820,7 +820,7 @@ public virtual void SettingAndGettingVariableWithDoubleValueIsCorrect() } [Test] - public virtual void SettingAndGettingVariableWithStringValueIsCorrect() + public virtual void SettingAndGettingVariableWithStringValue() { // Arrange const string variableName = "word"; @@ -854,7 +854,7 @@ public virtual void SettingAndGettingVariableWithStringValueIsCorrect() } [Test] - public virtual void SettingAndGettingVariableWithUnicodeStringValueIsCorrect() + public virtual void SettingAndGettingVariableWithUnicodeStringValue() { // Arrange const string variableName = "slovo"; @@ -888,7 +888,7 @@ public virtual void SettingAndGettingVariableWithUnicodeStringValueIsCorrect() } [Test] - public virtual void SettingAndGettingVariableWithNameContainingUnicodeCharactersIsCorrect() + public virtual void SettingAndGettingVariableWithNameContainingUnicodeCharacters() { // Arrange const string variableName = "слово"; @@ -922,7 +922,7 @@ public virtual void SettingAndGettingVariableWithNameContainingUnicodeCharacters } [Test] - public virtual void RemovingVariableIsCorrect() + public virtual void RemovingVariable() { // Arrange const string variableName = "price"; @@ -946,7 +946,7 @@ public virtual void RemovingVariableIsCorrect() } [Test] - public virtual void RemovingVariableWithNameContainingUnicodeCharactersIsCorrect() + public virtual void RemovingVariableWithNameContainingUnicodeCharacters() { // Arrange const string variableName = "цена"; @@ -974,7 +974,7 @@ public virtual void RemovingVariableWithNameContainingUnicodeCharactersIsCorrect #region Script interruption [Test] - public virtual void ScriptInterruptionIsCorrect() + public virtual void ScriptInterruption() { // Arrange const string sleepyСode = @"function sleep(millisecondsTimeout) { @@ -1029,7 +1029,7 @@ public virtual void ScriptInterruptionIsCorrect() #region Garbage collection [Test] - public virtual void GarbageCollectionIsCorrect() + public virtual void GarbageCollection() { // Arrange const string input = @"arr = []; for (i = 0; i < 1000000; i++) { arr.push(arr); }"; diff --git a/test/MsieJavaScriptEngine.Test.Common/ErrorFormattingTests.cs b/test/MsieJavaScriptEngine.Test.Common/ErrorFormattingTests.cs index bcd0519..b3551c0 100644 --- a/test/MsieJavaScriptEngine.Test.Common/ErrorFormattingTests.cs +++ b/test/MsieJavaScriptEngine.Test.Common/ErrorFormattingTests.cs @@ -8,7 +8,7 @@ namespace MsieJavaScriptEngine.Test.Common public class ErrorFormattingTests { [Test] - public void GettingSourceFragmentFromLineIsCorrect() + public void GettingSourceFragmentFromLine() { // Arrange const string input1 = ""; diff --git a/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs index 327f0eb..ca95a34 100644 --- a/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs @@ -10,7 +10,7 @@ public abstract class Es5TestsBase : TestsBase #region Array methods [Test] - public virtual void ArrayEveryMethodIsSupported() + public virtual void SupportsArrayEveryMethod() { // Arrange const string initCode = "var engines = ['Chakra', 'V8', 'SpiderMonkey', 'Jurassic'];"; @@ -39,7 +39,7 @@ public virtual void ArrayEveryMethodIsSupported() } [Test] - public virtual void ArrayFilterMethodIsSupported() + public virtual void SupportsArrayFilterMethod() { // Arrange const string initCode = "var engines = ['Chakra', 'V8', 'SpiderMonkey', 'Jurassic'];"; @@ -65,7 +65,7 @@ public virtual void ArrayFilterMethodIsSupported() } [Test] - public virtual void ArrayForEachMethodIsSupported() + public virtual void SupportsArrayForEachMethod() { // Arrange const string resultVariableName = "enginesString"; @@ -95,7 +95,7 @@ public virtual void ArrayForEachMethodIsSupported() } [Test] - public virtual void ArrayIndexOfMethodIsSupported() + public virtual void SupportsArrayIndexOfMethod() { // Arrange const string initCode = "var arr = [2, 5, 9, 2]"; @@ -154,7 +154,7 @@ public virtual void ArrayIndexOfMethodIsSupported() } [Test] - public virtual void ArrayIsArrayMethodIsSupported() + public virtual void SupportsArrayIsArrayMethod() { // Arrange const string input1 = "Array.isArray({ length: 0 });"; @@ -179,7 +179,7 @@ public virtual void ArrayIsArrayMethodIsSupported() } [Test] - public virtual void ArrayLastIndexOfMethodIsSupported() + public virtual void SupportsArrayLastIndexOfMethod() { // Arrange const string initCode = "var arr = [2, 5, 9, 2]"; @@ -238,7 +238,7 @@ public virtual void ArrayLastIndexOfMethodIsSupported() } [Test] - public virtual void ArrayMapMethodIsSupported() + public virtual void SupportsArrayMapMethod() { // Arrange const string initCode = "var engines = ['Chakra', 'V8', 'SpiderMonkey', 'Jurassic'];"; @@ -264,7 +264,7 @@ public virtual void ArrayMapMethodIsSupported() } [Test] - public virtual void ArrayReduceMethodIsSupported() + public virtual void SupportsArrayReduceMethod() { // Arrange const string input1 = @"[1, 2, 3, 4, 5].reduce(function (accum, value, index, array) { @@ -293,7 +293,7 @@ public virtual void ArrayReduceMethodIsSupported() } [Test] - public virtual void ArrayReduceRightMethodIsSupported() + public virtual void SupportsArrayReduceRightMethod() { // Arrange const string input1 = @"[1, 2, 3, 4, 5].reduceRight(function (accum, value, index, array) { @@ -322,7 +322,7 @@ public virtual void ArrayReduceRightMethodIsSupported() } [Test] - public virtual void ArraySomeMethodIsSupported() + public virtual void SupportsArraySomeMethod() { // Arrange const string initCode = "var engines = ['Chakra', 'V8', 'SpiderMonkey', 'Jurassic'];"; @@ -348,7 +348,7 @@ public virtual void ArraySomeMethodIsSupported() #region Date methods [Test] - public virtual void DateNowMethodIsSupported() + public virtual void SupportsDateNowMethod() { // Arrange const string input = "Date.now();"; @@ -367,7 +367,7 @@ public virtual void DateNowMethodIsSupported() } [Test] - public virtual void DateToIsoStringMethodIsSupported() + public virtual void SupportsDateToIsoStringMethod() { // Arrange const string input = @"(new Date(1386696984000)).toISOString();"; @@ -390,7 +390,7 @@ public virtual void DateToIsoStringMethodIsSupported() #region Function methods [Test] - public virtual void FunctionBindIsSupported() + public virtual void SupportsFunctionBindMethod() { // Arrange const string initCode = @"var a = 5, @@ -429,7 +429,7 @@ public virtual void FunctionBindIsSupported() #region JSON methods [Test] - public virtual void JsonParseMethodIsSupported() + public virtual void SupportsJsonParseMethod() { // Arrange const string initCode = "var obj = JSON.parse('{ \"foo\": \"bar\" }');"; @@ -450,7 +450,7 @@ public virtual void JsonParseMethodIsSupported() } [Test] - public virtual void JsonStringifyMethodIsSupported() + public virtual void SupportsJsonStringifyMethod() { // Arrange const string initCode = @"var obj = new Object(); @@ -476,7 +476,7 @@ public virtual void JsonStringifyMethodIsSupported() #region Object methods [Test] - public virtual void ObjectCreateMethodIsSupported() + public virtual void SupportsObjectCreateMethod() { // Arrange const string initCode1 = "var obj1 = Object.create(null);"; @@ -531,7 +531,7 @@ public virtual void ObjectCreateMethodIsSupported() } [Test] - public virtual void ObjectKeysMethodIsSupported() + public virtual void SupportsObjectKeysMethod() { // Arrange const string input1 = "Object.keys(['a', 'b', 'c']).toString();"; @@ -578,7 +578,7 @@ public virtual void ObjectKeysMethodIsSupported() #region String methods [Test] - public virtual void StringSplitMethodIsCorrect() + public virtual void SupportsStringSplitMethod() { // Arrange const string input1 = "'aaaa'.split(/a/).length;"; @@ -609,7 +609,7 @@ public virtual void StringSplitMethodIsCorrect() } [Test] - public virtual void StringTrimMethodIsSupported() + public virtual void SupportsStringTrimMethod() { // Arrange const string input = "' foo '.trim();"; diff --git a/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs index 62b5935..9bd2684 100644 --- a/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs @@ -21,7 +21,7 @@ public abstract class InteropTestsBase : FileSystemTestsBase #region Objects with fields [Test] - public virtual void EmbeddingOfInstanceOfCustomValueTypeWithFieldsIsCorrect() + public virtual void EmbeddingOfInstanceOfCustomValueTypeWithFields() { // Arrange var date = new Date(2015, 12, 29); @@ -58,7 +58,7 @@ public virtual void EmbeddingOfInstanceOfCustomValueTypeWithFieldsIsCorrect() } [Test] - public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithFieldsIsCorrect() + public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithFields() { // Arrange var product = new Product @@ -106,7 +106,7 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithFieldsIsCorrect( #region Objects with properties [Test] - public virtual void EmbeddingOfInstanceOfBuiltinValueTypeWithPropertiesIsCorrect() + public virtual void EmbeddingOfInstanceOfBuiltinValueTypeWithProperties() { // Arrange var timeSpan = new TimeSpan(4840780000000); @@ -147,7 +147,7 @@ public virtual void EmbeddingOfInstanceOfBuiltinValueTypeWithPropertiesIsCorrect } [Test] - public virtual void EmbeddingOfInstanceOfBuiltinReferenceTypeWithPropertiesIsCorrect() + public virtual void EmbeddingOfInstanceOfBuiltinReferenceTypeWithProperties() { // Arrange var uri = new Uri("https://github.com/Taritsyn/MsieJavaScriptEngine"); @@ -182,7 +182,7 @@ public virtual void EmbeddingOfInstanceOfBuiltinReferenceTypeWithPropertiesIsCor } [Test] - public virtual void EmbeddingOfInstanceOfCustomValueTypeWithPropertiesIsCorrect() + public virtual void EmbeddingOfInstanceOfCustomValueTypeWithProperties() { // Arrange var temperature = new Temperature(-17.3, TemperatureUnits.Celsius); @@ -217,7 +217,7 @@ public virtual void EmbeddingOfInstanceOfCustomValueTypeWithPropertiesIsCorrect( } [Test] - public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithPropertiesIsCorrect() + public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithProperties() { // Arrange var person = new Person("Vanya", "Ivanov"); @@ -255,7 +255,7 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithPropertiesIsCorr } [Test] - public virtual void EmbeddingOfInstanceOfAnonymousTypeWithPropertiesIsCorrect() + public virtual void EmbeddingOfInstanceOfAnonymousTypeWithProperties() { // Arrange var person = new @@ -323,7 +323,7 @@ public virtual void EmbeddingOfInstanceOfAnonymousTypeWithPropertiesIsCorrect() #region Objects with methods [Test] - public virtual void EmbeddingOfInstanceOfBuiltinValueTypeWithMethodsIsCorrect() + public virtual void EmbeddingOfInstanceOfBuiltinValueTypeWithMethods() { // Arrange var color = Color.FromArgb(84, 139, 212); @@ -358,7 +358,7 @@ public virtual void EmbeddingOfInstanceOfBuiltinValueTypeWithMethodsIsCorrect() } [Test] - public virtual void EmbeddingOfInstanceOfBuiltinReferenceTypeWithMethodIsCorrect() + public virtual void EmbeddingOfInstanceOfBuiltinReferenceTypeWithMethod() { // Arrange var random = new Random(); @@ -380,7 +380,7 @@ public virtual void EmbeddingOfInstanceOfBuiltinReferenceTypeWithMethodIsCorrect } [Test] - public virtual void EmbeddingOfInstanceOfCustomValueTypeWithMethodsIsCorrect() + public virtual void EmbeddingOfInstanceOfCustomValueTypeWithMethods() { // Arrange var programmerDayDate = new Date(2015, 9, 13); @@ -409,7 +409,7 @@ public virtual void EmbeddingOfInstanceOfCustomValueTypeWithMethodsIsCorrect() } [Test] - public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithMethodIsCorrect() + public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithMethod() { // Arrange var fileManager = new FileManager(); @@ -432,7 +432,7 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithMethodIsCorrect( } [Test] - public virtual void CallingOfMethodOfCustomReferenceTypeWithInterfaceParameterIsCorrect() + public virtual void CallingOfMethodOfCustomReferenceTypeWithInterfaceParameter() { // Arrange var animalTrainer = new AnimalTrainer(); @@ -468,7 +468,7 @@ public virtual void CallingOfMethodOfCustomReferenceTypeWithInterfaceParameterIs #region Delegates [Test] - public virtual void EmbeddingOfInstanceOfDelegateWithoutParametersIsCorrect() + public virtual void EmbeddingOfInstanceOfDelegateWithoutParameters() { // Arrange var generateRandomStringFunc = new Func(() => @@ -507,7 +507,7 @@ public virtual void EmbeddingOfInstanceOfDelegateWithoutParametersIsCorrect() } [Test] - public virtual void EmbeddingOfInstanceOfDelegateWithOneParameterIsCorrect() + public virtual void EmbeddingOfInstanceOfDelegateWithOneParameter() { // Arrange var squareFunc = new Func(a => a * a); @@ -529,7 +529,7 @@ public virtual void EmbeddingOfInstanceOfDelegateWithOneParameterIsCorrect() } [Test] - public virtual void EmbeddingOfInstanceOfDelegateWithTwoParametersIsCorrect() + public virtual void EmbeddingOfInstanceOfDelegateWithTwoParameters() { // Arrange var sumFunc = new Func((a, b) => a + b); @@ -551,7 +551,7 @@ public virtual void EmbeddingOfInstanceOfDelegateWithTwoParametersIsCorrect() } [Test] - public virtual void EmbeddingOfInstanceOfDelegateWithoutResultIsCorrect() + public virtual void EmbeddingOfInstanceOfDelegateWithoutResult() { // Arrange var logBuilder = new StringBuilder(); @@ -651,7 +651,7 @@ public virtual void CallingOfEmbeddedDelegateWithExtraParameter() #region Integration [Test] - public virtual void InteractionOfEmbeddedCustomValueTypeAndDelegateInstancesIsCorrect() + public virtual void InteractionOfEmbeddedCustomValueTypeAndDelegateInstances() { // Arrange var informaticsDayDate = new Date(2015, 12, 4); @@ -702,7 +702,7 @@ public virtual void InteractionOfEmbeddedCustomValueTypeAndDelegateInstancesIsCo #region Recursive calls [Test] - public virtual void RecursiveEvaluationOfFilesIsCorrect() + public virtual void RecursiveEvaluationOfFiles() { // Arrange string directoryPath = GetAbsolutePath("SharedFiles/recursiveEvaluation/noError"); @@ -731,7 +731,7 @@ public virtual void RecursiveEvaluationOfFilesIsCorrect() } [Test] - public virtual void RecursiveExecutionOfFilesIsCorrect() + public virtual void RecursiveExecutionOfFiles() { // Arrange string directoryPath = GetAbsolutePath("SharedFiles/recursiveExecution/noError"); @@ -761,7 +761,7 @@ public virtual void RecursiveExecutionOfFilesIsCorrect() #region Removal [Test] - public virtual void RemovingOfEmbeddedInstanceOfCustomReferenceTypeIsCorrect() + public virtual void RemovingOfEmbeddedInstanceOfCustomReferenceType() { // Arrange var person = new Person("Vasya", "Pupkin"); @@ -797,7 +797,7 @@ public virtual void RemovingOfEmbeddedInstanceOfCustomReferenceTypeIsCorrect() #region Creating of instances [Test] - public virtual void CreatingAnInstanceOfEmbeddedBuiltinValueTypeIsCorrect() + public virtual void CreatingAnInstanceOfEmbeddedBuiltinValueType() { // Arrange Type pointType = typeof(Point); @@ -819,7 +819,7 @@ public virtual void CreatingAnInstanceOfEmbeddedBuiltinValueTypeIsCorrect() } [Test] - public virtual void CreatingAnInstanceOfEmbeddedBuiltinReferenceTypeIsCorrect() + public virtual void CreatingAnInstanceOfEmbeddedBuiltinReferenceType() { // Arrange Type uriType = typeof(Uri); @@ -845,7 +845,7 @@ public virtual void CreatingAnInstanceOfEmbeddedBuiltinReferenceTypeIsCorrect() } [Test] - public virtual void CreatingAnInstanceOfEmbeddedCustomValueTypeIsCorrect() + public virtual void CreatingAnInstanceOfEmbeddedCustomValueType() { // Arrange Type point3DType = typeof(Point3D); @@ -867,7 +867,7 @@ public virtual void CreatingAnInstanceOfEmbeddedCustomValueTypeIsCorrect() } [Test] - public virtual void CreatingAnInstanceOfEmbeddedCustomReferenceTypeIsCorrect() + public virtual void CreatingAnInstanceOfEmbeddedCustomReferenceType() { // Arrange Type personType = typeof(Person); @@ -893,7 +893,7 @@ public virtual void CreatingAnInstanceOfEmbeddedCustomReferenceTypeIsCorrect() #region Types with constants [Test] - public virtual void EmbeddingOfBuiltinReferenceTypeWithConstantsIsCorrect() + public virtual void EmbeddingOfBuiltinReferenceTypeWithConstants() { // Arrange Type mathType = typeof(Math); @@ -922,7 +922,7 @@ public virtual void EmbeddingOfBuiltinReferenceTypeWithConstantsIsCorrect() } [Test] - public virtual void EmbeddingOfCustomValueTypeWithConstantsIsCorrect() + public virtual void EmbeddingOfCustomValueTypeWithConstants() { // Arrange Type predefinedStringsType = typeof(PredefinedStrings); @@ -957,7 +957,7 @@ public virtual void EmbeddingOfCustomValueTypeWithConstantsIsCorrect() } [Test] - public virtual void EmbeddingOfCustomReferenceTypeWithConstantIsCorrect() + public virtual void EmbeddingOfCustomReferenceTypeWithConstant() { // Arrange Type base64EncoderType = typeof(Base64Encoder); @@ -983,7 +983,7 @@ public virtual void EmbeddingOfCustomReferenceTypeWithConstantIsCorrect() #region Types with fields [Test] - public virtual void EmbeddingOfBuiltinValueTypeWithFieldIsCorrect() + public virtual void EmbeddingOfBuiltinValueTypeWithField() { // Arrange Type guidType = typeof(Guid); @@ -1005,7 +1005,7 @@ public virtual void EmbeddingOfBuiltinValueTypeWithFieldIsCorrect() } [Test] - public virtual void EmbeddingOfBuiltinReferenceTypeWithFieldIsCorrect() + public virtual void EmbeddingOfBuiltinReferenceTypeWithField() { // Arrange Type bitConverterType = typeof(BitConverter); @@ -1027,7 +1027,7 @@ public virtual void EmbeddingOfBuiltinReferenceTypeWithFieldIsCorrect() } [Test] - public virtual void EmbeddingOfCustomValueTypeWithFieldIsCorrect() + public virtual void EmbeddingOfCustomValueTypeWithField() { // Arrange Type point3DType = typeof(Point3D); @@ -1049,7 +1049,7 @@ public virtual void EmbeddingOfCustomValueTypeWithFieldIsCorrect() } [Test] - public virtual void EmbeddingOfCustomReferenceTypeWithFieldIsCorrect() + public virtual void EmbeddingOfCustomReferenceTypeWithField() { // Arrange Type defaultLoggerType = typeof(DefaultLogger); @@ -1080,7 +1080,7 @@ public virtual void EmbeddingOfCustomReferenceTypeWithFieldIsCorrect() #region Types with properties [Test] - public virtual void EmbeddingOfBuiltinValueTypeWithPropertyIsCorrect() + public virtual void EmbeddingOfBuiltinValueTypeWithProperty() { // Arrange Type colorType = typeof(Color); @@ -1102,7 +1102,7 @@ public virtual void EmbeddingOfBuiltinValueTypeWithPropertyIsCorrect() } [Test] - public virtual void EmbeddingOfBuiltinReferenceTypeWithPropertyIsCorrect() + public virtual void EmbeddingOfBuiltinReferenceTypeWithProperty() { // Arrange Type environmentType = typeof(Environment); @@ -1124,7 +1124,7 @@ public virtual void EmbeddingOfBuiltinReferenceTypeWithPropertyIsCorrect() } [Test] - public virtual void EmbeddingOfCustomValueTypeWithPropertyIsCorrect() + public virtual void EmbeddingOfCustomValueTypeWithProperty() { // Arrange Type dateType = typeof(Date); @@ -1157,7 +1157,7 @@ public virtual void EmbeddingOfCustomValueTypeWithPropertyIsCorrect() } [Test] - public virtual void EmbeddingOfCustomReferenceTypeWithPropertyIsCorrect() + public virtual void EmbeddingOfCustomReferenceTypeWithProperty() { // Arrange Type bundleTableType = typeof(BundleTable); @@ -1186,7 +1186,7 @@ public virtual void EmbeddingOfCustomReferenceTypeWithPropertyIsCorrect() #region Types with methods [Test] - public virtual void EmbeddingOfBuiltinValueTypeWithMethodIsCorrect() + public virtual void EmbeddingOfBuiltinValueTypeWithMethod() { // Arrange Type dateTimeType = typeof(DateTime); @@ -1208,7 +1208,7 @@ public virtual void EmbeddingOfBuiltinValueTypeWithMethodIsCorrect() } [Test] - public virtual void EmbeddingOfBuiltinReferenceTypeWithMethodsIsCorrect() + public virtual void EmbeddingOfBuiltinReferenceTypeWithMethods() { // Arrange Type mathType = typeof(Math); @@ -1236,7 +1236,7 @@ public virtual void EmbeddingOfBuiltinReferenceTypeWithMethodsIsCorrect() } [Test] - public virtual void EmbeddingOfCustomValueTypeWithMethodIsCorrect() + public virtual void EmbeddingOfCustomValueTypeWithMethod() { // Arrange var dateType = typeof(Date); @@ -1258,7 +1258,7 @@ public virtual void EmbeddingOfCustomValueTypeWithMethodIsCorrect() } [Test] - public virtual void EmbeddingOfCustomReferenceTypeWithMethodIsCorrect() + public virtual void EmbeddingOfCustomReferenceTypeWithMethod() { // Arrange Type base64EncoderType = typeof(Base64Encoder); @@ -1284,7 +1284,7 @@ public virtual void EmbeddingOfCustomReferenceTypeWithMethodIsCorrect() #region Removal [Test] - public virtual void RemovingOfEmbeddedCustomReferenceTypeIsCorrect() + public virtual void RemovingOfEmbeddedCustomReferenceType() { // Arrange Type personType = typeof(Person); diff --git a/test/MsieJavaScriptEngine.Test.Common/MultithreadingTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/MultithreadingTestsBase.cs index 8849530..2b1311c 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MultithreadingTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/MultithreadingTestsBase.cs @@ -8,7 +8,7 @@ namespace MsieJavaScriptEngine.Test.Common public abstract class MultithreadingTestsBase : TestsBase { [Test] - public virtual void ExecutionOfCodeFromDifferentThreadsIsCorrect() + public virtual void ExecutionOfCodeFromDifferentThreads() { // Arrange const string variableName = "foo"; diff --git a/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs index 60fe323..b50d472 100644 --- a/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs @@ -14,7 +14,7 @@ public abstract class PrecompilationTestsBase : FileSystemTestsBase #region Execution of precompiled scripts [Test] - public virtual void ExecutionOfPrecompiledCodeIsCorrect() + public virtual void ExecutionOfPrecompiledCode() { // Arrange const string libraryCode = @"function declensionOfNumerals(number, titles) { @@ -86,7 +86,7 @@ function declinationOfSeconds(number) { } [Test] - public virtual void ExecutionOfPrecompiledFileIsCorrect() + public virtual void ExecutionOfPrecompiledFile() { // Arrange string filePath = GetAbsolutePath("SharedFiles/declinationOfMinutes.js"); @@ -136,7 +136,7 @@ public virtual void ExecutionOfPrecompiledFileIsCorrect() } [Test] - public virtual void ExecutionOfPrecompiledResourceByNameAndTypeIsCorrect() + public virtual void ExecutionOfPrecompiledResourceByNameAndType() { // Arrange const string resourceName = "Resources.declinationOfHours.js"; @@ -186,7 +186,7 @@ public virtual void ExecutionOfPrecompiledResourceByNameAndTypeIsCorrect() } [Test] - public virtual void ExecutionOfPrecompiledResourceByNameAndAssemblyIsCorrect() + public virtual void ExecutionOfPrecompiledResourceByNameAndAssembly() { // Arrange const string resourceName = "MsieJavaScriptEngine.Test.Common.Resources.declinationOfDays.js"; diff --git a/test/MsieJavaScriptEngine.Test.Common/ValidationTests.cs b/test/MsieJavaScriptEngine.Test.Common/ValidationTests.cs index 7acc226..a9c90a5 100644 --- a/test/MsieJavaScriptEngine.Test.Common/ValidationTests.cs +++ b/test/MsieJavaScriptEngine.Test.Common/ValidationTests.cs @@ -8,7 +8,7 @@ namespace MsieJavaScriptEngine.Test.Common public class ValidationTests { [Test] - public void NameFormatIsCorrect() + public void CheckingOfCorrectNameFormat() { // Arrange @@ -30,7 +30,7 @@ public void NameFormatIsCorrect() } [Test] - public void NameFormatIsWrong() + public void CheckingOfWrongNameFormat() { // Arrange @@ -50,7 +50,7 @@ public void NameFormatIsWrong() } [Test] - public void DocumentNameFormatIsCorrect() + public void CheckingOfCorrectDocumentNameFormat() { // Arrange @@ -74,7 +74,7 @@ public void DocumentNameFormatIsCorrect() } [Test] - public void DocumentNameFormatIsWrong() + public void CheckingOfWrongDocumentNameFormat() { // Arrange From 3cce29f0a90dd0e6c4d943ca43d093d9b11212be Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Fri, 3 Feb 2023 20:57:14 +0300 Subject: [PATCH 07/28] In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no longer used for embedding objects and types --- .../{ => ActiveScript}/HostItemBase.cs | 2 +- .../{ => ActiveScript}/HostObject.cs | 2 +- .../{ => ActiveScript}/HostType.cs | 2 +- .../Extensions/StringExtensions.cs | 5 +- .../Helpers/ComHelpers.cs | 34 ---- .../Helpers/NumericHelpers.cs | 28 --- .../Helpers/ReflectionHelpers.cs | 7 +- .../Helpers/TypeMappingHelpers.cs | 1 + .../JsRt/Edge/EdgeJsValue.cs | 35 ---- .../JsRt/Edge/EdgeNativeMethods.cs | 10 -- .../JsRt/Edge/EdgeTypeMapper.cs | 106 +++--------- .../JsRt/Embedding/EmbeddedItem.cs | 8 +- .../JsRt/Embedding/EmbeddedObject.cs | 6 +- .../JsRt/Embedding/EmbeddedObjectKey.cs | 10 +- .../JsRt/Embedding/EmbeddedType.cs | 6 +- src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs | 35 ---- .../JsRt/Ie/IeNativeMethods.cs | 10 -- .../JsRt/Ie/IeTypeMapper.cs | 101 +++-------- src/MsieJavaScriptEngine/JsRt/TypeMapper.cs | 38 +---- .../MsieJavaScriptEngine.csproj | 2 +- .../Resources/CommonStrings.Designer.cs | 160 +++++++++++++++++- .../Resources/CommonStrings.resx | 60 ++++++- .../Resources/CommonStrings.ru-RU.resx | 60 ++++++- .../Resources/NetCoreStrings.Designer.cs | 152 ----------------- .../Resources/NetCoreStrings.resx | 57 ------- ...er.cs => NetCoreStrings.ru-RU.Designer.cs} | 0 ...s.ru-ru.resx => NetCoreStrings.ru-RU.resx} | 57 ------- .../NetFrameworkStrings.ru-RU.Designer.cs | 0 ...ru.resx => NetFrameworkStrings.ru-RU.resx} | 0 src/MsieJavaScriptEngine/Utilities/Utils.cs | 49 ------ src/MsieJavaScriptEngine/readme.txt | 3 +- .../InteropTests.cs | 2 - .../InteropTests.cs | 2 - 33 files changed, 345 insertions(+), 705 deletions(-) rename src/MsieJavaScriptEngine/{ => ActiveScript}/HostItemBase.cs (99%) rename src/MsieJavaScriptEngine/{ => ActiveScript}/HostObject.cs (98%) rename src/MsieJavaScriptEngine/{ => ActiveScript}/HostType.cs (97%) rename src/MsieJavaScriptEngine/Resources/{NetCoreStrings.ru-ru.Designer.cs => NetCoreStrings.ru-RU.Designer.cs} (100%) rename src/MsieJavaScriptEngine/Resources/{NetCoreStrings.ru-ru.resx => NetCoreStrings.ru-RU.resx} (56%) create mode 100644 src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-RU.Designer.cs rename src/MsieJavaScriptEngine/Resources/{NetFrameworkStrings.ru-ru.resx => NetFrameworkStrings.ru-RU.resx} (100%) diff --git a/src/MsieJavaScriptEngine/HostItemBase.cs b/src/MsieJavaScriptEngine/ActiveScript/HostItemBase.cs similarity index 99% rename from src/MsieJavaScriptEngine/HostItemBase.cs rename to src/MsieJavaScriptEngine/ActiveScript/HostItemBase.cs index 2528ff0..5e9cbf7 100644 --- a/src/MsieJavaScriptEngine/HostItemBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/HostItemBase.cs @@ -5,7 +5,7 @@ using MsieJavaScriptEngine.Helpers; -namespace MsieJavaScriptEngine +namespace MsieJavaScriptEngine.ActiveScript { /// /// Base class of item, that implements interface diff --git a/src/MsieJavaScriptEngine/HostObject.cs b/src/MsieJavaScriptEngine/ActiveScript/HostObject.cs similarity index 98% rename from src/MsieJavaScriptEngine/HostObject.cs rename to src/MsieJavaScriptEngine/ActiveScript/HostObject.cs index 6895a86..fd91ba0 100644 --- a/src/MsieJavaScriptEngine/HostObject.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/HostObject.cs @@ -7,7 +7,7 @@ using MsieJavaScriptEngine.Constants; using MsieJavaScriptEngine.Helpers; -namespace MsieJavaScriptEngine +namespace MsieJavaScriptEngine.ActiveScript { /// /// Wrapper for object, that implements interface diff --git a/src/MsieJavaScriptEngine/HostType.cs b/src/MsieJavaScriptEngine/ActiveScript/HostType.cs similarity index 97% rename from src/MsieJavaScriptEngine/HostType.cs rename to src/MsieJavaScriptEngine/ActiveScript/HostType.cs index aa258c4..0071c0b 100644 --- a/src/MsieJavaScriptEngine/HostType.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/HostType.cs @@ -7,7 +7,7 @@ using MsieJavaScriptEngine.Constants; using MsieJavaScriptEngine.Helpers; -namespace MsieJavaScriptEngine +namespace MsieJavaScriptEngine.ActiveScript { /// /// Wrapper for type, that implements interface diff --git a/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs b/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs index 1215e0c..e1b71ba 100644 --- a/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs +++ b/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; namespace MsieJavaScriptEngine.Extensions { @@ -63,6 +62,7 @@ public static string TrimStart(this string source, string trimString) return result; } +#if NETFRAMEWORK /// /// Converts a first letter of string to capital @@ -83,7 +83,7 @@ public static string CapitalizeFirstLetter(this string source) } string result; - char firstCharacter = source.First(); + char firstCharacter = source[0]; if (char.IsLower(firstCharacter)) { @@ -100,6 +100,7 @@ public static string CapitalizeFirstLetter(this string source) return result; } +#endif /// /// Splits a string into lines diff --git a/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs index 0168559..525c056 100644 --- a/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ComHelpers.cs @@ -27,26 +27,6 @@ public static IntPtr CreateInstanceByClsid(Guid clsid) return pInterface; } - public static IntPtr CreateInstanceByProgId(string progId) - { - Guid clsid = ClsidFromProgId(progId); - IntPtr pInterface = CreateInstanceByClsid(clsid); - - return pInterface; - } - - private static Guid ClsidFromProgId(string progId) - { - Guid clsid; - - if (!Guid.TryParseExact(progId, "B", out clsid)) - { - HResult.Check(NativeMethods.CLSIDFromProgID(progId, out clsid)); - } - - return clsid; - } - public static bool TryCreateComObject(string progId, string serverName, out T obj) where T : class { Type type; @@ -92,14 +72,6 @@ public static IntPtr QueryInterfaceNoThrow(IntPtr pUnknown) return result == ComErrorCode.S_OK ? pInterface : IntPtr.Zero; } - public static T GetMethodDelegate(IntPtr pInterface, int methodIndex) where T : class - { - var pVTable = Marshal.ReadIntPtr(pInterface); - var pMethod = Marshal.ReadIntPtr(pVTable + methodIndex * IntPtr.Size); - - return Marshal.GetDelegateForFunctionPointer(pMethod, typeof(T)) as T; - } - public static void ReleaseAndEmpty(ref IntPtr pUnk) { if (pUnk != IntPtr.Zero) @@ -121,12 +93,6 @@ public static extern uint CoCreateInstance( [In] ref Guid iid, [Out] out IntPtr pInterface ); - - [DllImport("ole32.dll", ExactSpelling = true)] - public static extern uint CLSIDFromProgID( - [In] [MarshalAs(UnmanagedType.LPWStr)] string progId, - [Out] out Guid clsid - ); } #endregion diff --git a/src/MsieJavaScriptEngine/Helpers/NumericHelpers.cs b/src/MsieJavaScriptEngine/Helpers/NumericHelpers.cs index bd26b34..7afb9f2 100644 --- a/src/MsieJavaScriptEngine/Helpers/NumericHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/NumericHelpers.cs @@ -12,34 +12,6 @@ internal static class NumericHelpers private const double MAX_INTEGER_IN_DOUBLE = (1L << 53) - 1; - /// - /// Gets a value indicating whether the specified type is one of the numeric types - /// - /// The type - /// true if the specified type is one of the numeric types; otherwise, false - public static bool IsNumericType(Type type) - { - TypeCode typeCode = type.GetTypeCode(); - - switch (typeCode) - { - case TypeCode.SByte: - case TypeCode.Byte: - case TypeCode.Int16: - case TypeCode.UInt16: - case TypeCode.Int32: - case TypeCode.UInt32: - case TypeCode.Int64: - case TypeCode.UInt64: - case TypeCode.Single: - case TypeCode.Double: - case TypeCode.Decimal: - return true; - default: - return false; - } - } - /// /// Casts a double value to the correct type /// diff --git a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs index c51cabd..62536d5 100644 --- a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs @@ -1,13 +1,9 @@ using System; -#if !NETFRAMEWORK using System.Collections.Generic; using System.Linq; -#endif using System.Reflection; -#if !NETFRAMEWORK using MsieJavaScriptEngine.Utilities; -#endif namespace MsieJavaScriptEngine.Helpers { @@ -66,7 +62,7 @@ public static MethodInfo[] GetFullyFledgedMethods(MethodInfo[] methods) return fullyFledgedMethods; } -#else +#endif public static void FixFieldValueType(ref object value, FieldInfo field) { @@ -269,6 +265,5 @@ public ushort CompatibilityScore set; } } -#endif } } \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs b/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs index e37a7e8..424f45a 100644 --- a/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs @@ -2,6 +2,7 @@ using System; using System.Linq; +using MsieJavaScriptEngine.ActiveScript; using MsieJavaScriptEngine.Utilities; namespace MsieJavaScriptEngine.Helpers diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs index 800d4b1..67e8c34 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs @@ -304,24 +304,6 @@ public static EdgeJsValue FromString(string value) return reference; } -#if NETFRAMEWORK - - /// - /// Creates a JavaScript value that is a projection of the passed in object - /// - /// - /// Requires an active script context. - /// - /// The object to be projected - /// The JavaScript value that is a projection of the object - public static EdgeJsValue FromObject(object value) - { - EdgeJsValue reference; - EdgeJsErrorHelpers.ThrowIfError(EdgeNativeMethods.JsVariantToValue(ref value, out reference)); - - return reference; - } -#endif /// /// Creates a new Object @@ -611,23 +593,6 @@ public int ToInt32() return Marshal.PtrToStringUni(buffer, (int)length); } -#if NETFRAMEWORK - - /// - /// Retrieves a object representation of an Object value - /// - /// - /// Requires an active script context. - /// - /// The object representation of the value - public object ToObject() - { - object value; - EdgeJsErrorHelpers.ThrowIfError(EdgeNativeMethods.JsValueToVariant(this, out value)); - - return value; - } -#endif /// /// Converts a value to Boolean using regular JavaScript semantics diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs index 482d292..0e8dd7a 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeNativeMethods.cs @@ -148,16 +148,6 @@ internal static extern JsErrorCode JsSetRuntimeBeforeCollectCallback(EdgeJsRunti [DllImport(DllName.Chakra)] internal static extern JsErrorCode JsConvertValueToString(EdgeJsValue value, out EdgeJsValue stringValue); -#if NETFRAMEWORK - - [DllImport(DllName.Chakra)] - internal static extern JsErrorCode JsVariantToValue([MarshalAs(UnmanagedType.Struct)] ref object var, - out EdgeJsValue value); - - [DllImport(DllName.Chakra)] - internal static extern JsErrorCode JsValueToVariant(EdgeJsValue obj, - [MarshalAs(UnmanagedType.Struct)] out object var); -#endif [DllImport(DllName.Chakra)] internal static extern JsErrorCode JsGetGlobalObject(out EdgeJsValue globalObject); diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs index c6fd0ab..37ca65b 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs @@ -1,36 +1,23 @@ using System; -#if !NETFRAMEWORK using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -#endif using MsieJavaScriptEngine.Extensions; using MsieJavaScriptEngine.Helpers; -#if !NETFRAMEWORK using MsieJavaScriptEngine.JsRt.Embedding; using MsieJavaScriptEngine.Resources; -#endif -#if NETFRAMEWORK -using MsieJavaScriptEngine.Utilities; -#endif -#if !NETFRAMEWORK using WrapperException = MsieJavaScriptEngine.JsException; -using WrapperRuntimeException = MsieJavaScriptEngine.JsRuntimeException; -using WrapperScriptException = MsieJavaScriptEngine.JsScriptException; -#endif namespace MsieJavaScriptEngine.JsRt.Edge { -#if !NETFRAMEWORK using EdgeEmbeddedItem = EmbeddedItem; using EdgeEmbeddedObject = EmbeddedObject; using EdgeEmbeddedType = EmbeddedType; -#endif /// /// “Edge” type mapper /// @@ -40,39 +27,9 @@ internal sealed class EdgeTypeMapper : TypeMapper public EdgeTypeMapper() -#if NETFRAMEWORK - : base(JsEngineMode.ChakraEdgeJsRt) -#endif { } -#if NETFRAMEWORK - /// - /// Creates a JavaScript value from an host object if the it does not already exist - /// - /// Instance of host type - /// JavaScript value created from an host object - public override EdgeJsValue GetOrCreateScriptObject(object obj) - { - var wrappedObj = new HostObject(obj, _engineMode); - EdgeJsValue objValue = EdgeJsValue.FromObject(wrappedObj); - - return objValue; - } - - /// - /// Creates a JavaScript value from an host type if the it does not already exist - /// - /// Host type - /// JavaScript value created from an host type - public override EdgeJsValue GetOrCreateScriptType(Type type) - { - var wrappedType = new HostType(type, _engineMode); - EdgeJsValue typeValue = EdgeJsValue.FromObject(wrappedType); - - return typeValue; - } -#endif /// /// Makes a mapping of value from the host type to a script type /// @@ -148,7 +105,6 @@ public override object MapToHostType(EdgeJsValue value) case JsValueType.String: result = value.ToString(); break; -#if !NETFRAMEWORK case JsValueType.Function: EdgeJsPropertyId externalObjectPropertyId = EdgeJsPropertyId.FromString(ExternalObjectPropertyName); if (value.HasProperty(externalObjectPropertyId)) @@ -160,23 +116,11 @@ public override object MapToHostType(EdgeJsValue value) result = result ?? value.ConvertToObject(); break; -#endif case JsValueType.Object: -#if NETFRAMEWORK - case JsValueType.Function: -#endif case JsValueType.Error: case JsValueType.Array: -#if !NETFRAMEWORK result = value.HasExternalData ? GCHandle.FromIntPtr(value.ExternalData).Target : value.ConvertToObject(); -#else - EdgeJsValue processedValue = valueType != JsValueType.Object ? - value.ConvertToObject() : value; - object obj = processedValue.ToObject(); - var hostObj = obj as HostObject; - result = hostObj != null ? hostObj.Target : obj; -#endif break; default: throw new ArgumentOutOfRangeException(); @@ -184,7 +128,6 @@ public override object MapToHostType(EdgeJsValue value) return result; } -#if !NETFRAMEWORK protected override EdgeEmbeddedObject CreateEmbeddedObjectOrFunction(object obj) { @@ -217,7 +160,11 @@ private EdgeEmbeddedObject CreateEmbeddedFunction(Delegate del) { EdgeJsNativeFunction nativeFunction = (callee, isConstructCall, args, argCount, callbackData) => { +#if NET40 + MethodInfo method = del.Method; +#else MethodInfo method = del.GetMethodInfo(); +#endif ParameterInfo[] parameters = method.GetParameters(); object[] processedArgs = GetHostItemMemberArguments(args, parameters.Length); @@ -238,7 +185,7 @@ private EdgeEmbeddedObject CreateEmbeddedFunction(Delegate del) CreateErrorFromWrapperException(wrapperException) : EdgeJsErrorHelpers.CreateError(string.Format( - NetCoreStrings.Runtime_HostDelegateInvocationFailed, exception.Message)) + CommonStrings.Runtime_HostDelegateInvocationFailed, exception.Message)) ; EdgeJsContext.SetException(errorValue); @@ -265,7 +212,11 @@ private EdgeEmbeddedObject CreateEmbeddedFunction(Delegate del) protected override EdgeEmbeddedType CreateEmbeddedType(Type type) { +#if NET40 + Type typeInfo = type; +#else TypeInfo typeInfo = type.GetTypeInfo(); +#endif string typeName = type.FullName; BindingFlags defaultBindingFlags = ReflectionHelpers.GetDefaultBindingFlags(true); ConstructorInfo[] constructors = type.GetConstructors(defaultBindingFlags); @@ -288,7 +239,7 @@ protected override EdgeEmbeddedType CreateEmbeddedType(Type type) if (constructors.Length == 0) { - CreateAndSetError(string.Format(NetCoreStrings.Runtime_HostTypeConstructorNotFound, typeName)); + CreateAndSetError(string.Format(CommonStrings.Runtime_HostTypeConstructorNotFound, typeName)); return undefinedValue; } @@ -297,7 +248,7 @@ protected override EdgeEmbeddedType CreateEmbeddedType(Type type) if (bestFitConstructor == null) { CreateAndSetReferenceError(string.Format( - NetCoreStrings.Runtime_SuitableConstructorOfHostTypeNotFound, typeName)); + CommonStrings.Runtime_SuitableConstructorOfHostTypeNotFound, typeName)); return undefinedValue; } @@ -315,7 +266,7 @@ protected override EdgeEmbeddedType CreateEmbeddedType(Type type) CreateErrorFromWrapperException(wrapperException) : EdgeJsErrorHelpers.CreateError(string.Format( - NetCoreStrings.Runtime_HostTypeConstructorInvocationFailed, typeName, exception.Message)) + CommonStrings.Runtime_HostTypeConstructorInvocationFailed, typeName, exception.Message)) ; EdgeJsContext.SetException(errorValue); @@ -372,7 +323,7 @@ private void ProjectFields(EdgeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); return undefinedValue; } @@ -395,10 +346,10 @@ private void ProjectFields(EdgeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectFieldGettingFailed, fieldName, + string.Format(CommonStrings.Runtime_HostObjectFieldGettingFailed, fieldName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypeFieldGettingFailed, fieldName, typeName, + string.Format(CommonStrings.Runtime_HostTypeFieldGettingFailed, fieldName, typeName, exception.Message) ; errorValue = EdgeJsErrorHelpers.CreateError(errorMessage); @@ -424,7 +375,7 @@ private void ProjectFields(EdgeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); return undefinedValue; } @@ -448,10 +399,10 @@ private void ProjectFields(EdgeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectFieldSettingFailed, fieldName, + string.Format(CommonStrings.Runtime_HostObjectFieldSettingFailed, fieldName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypeFieldSettingFailed, fieldName, typeName, + string.Format(CommonStrings.Runtime_HostTypeFieldSettingFailed, fieldName, typeName, exception.Message) ; errorValue = EdgeJsErrorHelpers.CreateError(errorMessage); @@ -500,7 +451,7 @@ private void ProjectProperties(EdgeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); return undefinedValue; } @@ -523,10 +474,10 @@ private void ProjectProperties(EdgeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectPropertyGettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostObjectPropertyGettingFailed, propertyName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypePropertyGettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostTypePropertyGettingFailed, propertyName, typeName, exception.Message) ; errorValue = EdgeJsErrorHelpers.CreateError(errorMessage); @@ -555,7 +506,7 @@ private void ProjectProperties(EdgeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); return undefinedValue; } @@ -579,10 +530,10 @@ private void ProjectProperties(EdgeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectPropertySettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostObjectPropertySettingFailed, propertyName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypePropertySettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostTypePropertySettingFailed, propertyName, typeName, exception.Message) ; errorValue = EdgeJsErrorHelpers.CreateError(errorMessage); @@ -630,7 +581,7 @@ private void ProjectMethods(EdgeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectMethod, methodName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectMethod, methodName)); return undefinedValue; } @@ -641,7 +592,7 @@ private void ProjectMethods(EdgeEmbeddedItem externalItem) if (bestFitMethod == null) { CreateAndSetReferenceError(string.Format( - NetCoreStrings.Runtime_SuitableMethodOfHostObjectNotFound, methodName)); + CommonStrings.Runtime_SuitableMethodOfHostObjectNotFound, methodName)); return undefinedValue; } @@ -666,10 +617,10 @@ private void ProjectMethods(EdgeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectMethodInvocationFailed, methodName, + string.Format(CommonStrings.Runtime_HostObjectMethodInvocationFailed, methodName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypeMethodInvocationFailed, methodName, typeName, + string.Format(CommonStrings.Runtime_HostTypeMethodInvocationFailed, methodName, typeName, exception.Message) ; errorValue = EdgeJsErrorHelpers.CreateError(errorMessage); @@ -745,6 +696,5 @@ private static EdgeJsValue CreateErrorFromWrapperException(WrapperException exce return errorValue; } -#endif } } \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs index 1a109a4..8dbad02 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedItem.cs @@ -1,5 +1,4 @@ -#if !NETFRAMEWORK -using System; +using System; using System.Collections.Generic; using MsieJavaScriptEngine.Utilities; @@ -38,7 +37,7 @@ internal abstract class EmbeddedItem : IDisposable /// /// Flag indicating whether this object is disposed /// - private readonly InterlockedStatedFlag _disposedFlag = new InterlockedStatedFlag(); + private InterlockedStatedFlag _disposedFlag = new InterlockedStatedFlag(); /// /// Gets a host type @@ -121,5 +120,4 @@ public void Dispose() #endregion } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs index 1902505..8300a73 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObject.cs @@ -1,5 +1,4 @@ -#if !NETFRAMEWORK -using System; +using System; using System.Collections.Generic; namespace MsieJavaScriptEngine.JsRt.Embedding @@ -44,5 +43,4 @@ public override bool IsInstance #endregion } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs index bc18574..1bd3b1f 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedObjectKey.cs @@ -1,5 +1,4 @@ -#if !NETFRAMEWORK -using System; +using System; using System.Collections; using System.Collections.Generic; @@ -84,7 +83,7 @@ int IComparable.CompareTo(object other) if (!(other is EmbeddedObjectKey)) { throw new ArgumentException( - string.Format(NetCoreStrings.Common_ArgumentHasIncorrectType, nameof(other), + string.Format(CommonStrings.Common_ArgumentHasIncorrectType, nameof(other), other.GetType().Name), nameof(other) ); @@ -122,7 +121,7 @@ int IStructuralComparable.CompareTo(object other, IComparer comparer) if (!(other is EmbeddedObjectKey)) { throw new ArgumentException( - string.Format(NetCoreStrings.Common_ArgumentHasIncorrectType, nameof(other), + string.Format(CommonStrings.Common_ArgumentHasIncorrectType, nameof(other), other.GetType().Name), nameof(other) ); @@ -161,5 +160,4 @@ public override string ToString() #endregion } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs index 680ad70..479ce5f 100644 --- a/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs +++ b/src/MsieJavaScriptEngine/JsRt/Embedding/EmbeddedType.cs @@ -1,5 +1,4 @@ -#if !NETFRAMEWORK -using System; +using System; using System.Collections.Generic; namespace MsieJavaScriptEngine.JsRt.Embedding @@ -44,5 +43,4 @@ public override bool IsInstance #endregion } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs index 1113218..b07fe42 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs @@ -305,24 +305,6 @@ public static IeJsValue FromString(string value) return reference; } -#if NETFRAMEWORK - - /// - /// Creates a JavaScript value that is a projection of the passed in object - /// - /// - /// Requires an active script context. - /// - /// The object to be projected - /// The JavaScript value that is a projection of the object - public static IeJsValue FromObject(object value) - { - IeJsValue reference; - IeJsErrorHelpers.ThrowIfError(IeNativeMethods.JsVariantToValue(ref value, out reference)); - - return reference; - } -#endif /// /// Creates a new Object @@ -611,23 +593,6 @@ public int ToInt32() return Marshal.PtrToStringUni(buffer, (int)length); } -#if NETFRAMEWORK - - /// - /// Retrieves a object representation of an Object value - /// - /// - /// Requires an active script context. - /// - /// The object representation of the value - public object ToObject() - { - object value; - IeJsErrorHelpers.ThrowIfError(IeNativeMethods.JsValueToVariant(this, out value)); - - return value; - } -#endif /// /// Converts a value to Boolean using regular JavaScript semantics diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs index 5529a2a..4b9aabd 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeNativeMethods.cs @@ -154,16 +154,6 @@ internal static extern JsErrorCode JsCreateContext(IeJsRuntime runtime, IDebugAp [DllImport(DllName.JScript9)] internal static extern JsErrorCode JsConvertValueToString(IeJsValue value, out IeJsValue stringValue); -#if NETFRAMEWORK - - [DllImport(DllName.JScript9)] - internal static extern JsErrorCode JsVariantToValue([MarshalAs(UnmanagedType.Struct)] ref object var, - out IeJsValue value); - - [DllImport(DllName.JScript9)] - internal static extern JsErrorCode JsValueToVariant(IeJsValue obj, - [MarshalAs(UnmanagedType.Struct)] out object var); -#endif [DllImport(DllName.JScript9)] internal static extern JsErrorCode JsGetGlobalObject(out IeJsValue globalObject); diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs index a0c7ebd..5d50d7c 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs @@ -1,31 +1,23 @@ using System; -#if !NETFRAMEWORK using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -#endif using MsieJavaScriptEngine.Extensions; using MsieJavaScriptEngine.Helpers; -#if !NETFRAMEWORK using MsieJavaScriptEngine.JsRt.Embedding; using MsieJavaScriptEngine.Resources; using WrapperException = MsieJavaScriptEngine.JsException; -using WrapperRuntimeException = MsieJavaScriptEngine.JsRuntimeException; -using WrapperScriptException = MsieJavaScriptEngine.JsScriptException; -#endif namespace MsieJavaScriptEngine.JsRt.Ie { -#if !NETFRAMEWORK using IeEmbeddedItem = EmbeddedItem; using IeEmbeddedObject = EmbeddedObject; using IeEmbeddedType = EmbeddedType; -#endif /// /// “IE” type mapper /// @@ -35,39 +27,9 @@ internal sealed class IeTypeMapper : TypeMapper /// Constructs an instance of the “IE” type mapper /// public IeTypeMapper() -#if NETFRAMEWORK - : base(JsEngineMode.ChakraIeJsRt) -#endif { } -#if NETFRAMEWORK - /// - /// Creates a JavaScript value from an host object if the it does not already exist - /// - /// Instance of host type - /// JavaScript value created from an host object - public override IeJsValue GetOrCreateScriptObject(object obj) - { - var wrappedObj = new HostObject(obj, _engineMode); - IeJsValue objValue = IeJsValue.FromObject(wrappedObj); - - return objValue; - } - - /// - /// Creates a JavaScript value from an host type if the it does not already exist - /// - /// Host type - /// JavaScript value created from an host type - public override IeJsValue GetOrCreateScriptType(Type type) - { - var wrappedType = new HostType(type, _engineMode); - IeJsValue typeValue = IeJsValue.FromObject(wrappedType); - - return typeValue; - } -#endif /// /// Makes a mapping of value from the host type to a script type /// @@ -143,7 +105,6 @@ public override object MapToHostType(IeJsValue value) case JsValueType.String: result = value.ToString(); break; -#if !NETFRAMEWORK case JsValueType.Function: IeJsPropertyId externalObjectPropertyId = IeJsPropertyId.FromString(ExternalObjectPropertyName); if (value.HasProperty(externalObjectPropertyId)) @@ -155,23 +116,11 @@ public override object MapToHostType(IeJsValue value) result = result ?? value.ConvertToObject(); break; -#endif case JsValueType.Object: -#if NETFRAMEWORK - case JsValueType.Function: -#endif case JsValueType.Error: case JsValueType.Array: -#if !NETFRAMEWORK result = value.HasExternalData ? GCHandle.FromIntPtr(value.ExternalData).Target : value.ConvertToObject(); -#else - IeJsValue processedValue = valueType != JsValueType.Object ? - value.ConvertToObject() : value; - object obj = processedValue.ToObject(); - var hostObj = obj as HostObject; - result = hostObj != null ? hostObj.Target : obj; -#endif break; default: throw new ArgumentOutOfRangeException(); @@ -179,7 +128,6 @@ public override object MapToHostType(IeJsValue value) return result; } -#if !NETFRAMEWORK protected override IeEmbeddedObject CreateEmbeddedObjectOrFunction(object obj) { @@ -212,7 +160,11 @@ private IeEmbeddedObject CreateEmbeddedFunction(Delegate del) { IeJsNativeFunction nativeFunction = (callee, isConstructCall, args, argCount, callbackData) => { +#if NET40 + MethodInfo method = del.Method; +#else MethodInfo method = del.GetMethodInfo(); +#endif ParameterInfo[] parameters = method.GetParameters(); object[] processedArgs = GetHostItemMemberArguments(args, parameters.Length); @@ -233,7 +185,7 @@ private IeEmbeddedObject CreateEmbeddedFunction(Delegate del) CreateErrorFromWrapperException(wrapperException) : IeJsErrorHelpers.CreateError(string.Format( - NetCoreStrings.Runtime_HostDelegateInvocationFailed, exception.Message)) + CommonStrings.Runtime_HostDelegateInvocationFailed, exception.Message)) ; IeJsContext.SetException(errorValue); @@ -260,7 +212,11 @@ private IeEmbeddedObject CreateEmbeddedFunction(Delegate del) protected override IeEmbeddedType CreateEmbeddedType(Type type) { +#if NET40 + Type typeInfo = type; +#else TypeInfo typeInfo = type.GetTypeInfo(); +#endif string typeName = type.FullName; BindingFlags defaultBindingFlags = ReflectionHelpers.GetDefaultBindingFlags(true); ConstructorInfo[] constructors = type.GetConstructors(defaultBindingFlags); @@ -283,7 +239,7 @@ protected override IeEmbeddedType CreateEmbeddedType(Type type) if (constructors.Length == 0) { - CreateAndSetError(string.Format(NetCoreStrings.Runtime_HostTypeConstructorNotFound, typeName)); + CreateAndSetError(string.Format(CommonStrings.Runtime_HostTypeConstructorNotFound, typeName)); return undefinedValue; } @@ -292,7 +248,7 @@ protected override IeEmbeddedType CreateEmbeddedType(Type type) if (bestFitConstructor == null) { CreateAndSetReferenceError(string.Format( - NetCoreStrings.Runtime_SuitableConstructorOfHostTypeNotFound, typeName)); + CommonStrings.Runtime_SuitableConstructorOfHostTypeNotFound, typeName)); return undefinedValue; } @@ -310,7 +266,7 @@ protected override IeEmbeddedType CreateEmbeddedType(Type type) CreateErrorFromWrapperException(wrapperException) : IeJsErrorHelpers.CreateError(string.Format( - NetCoreStrings.Runtime_HostTypeConstructorInvocationFailed, typeName, exception.Message)) + CommonStrings.Runtime_HostTypeConstructorInvocationFailed, typeName, exception.Message)) ; IeJsContext.SetException(errorValue); @@ -367,7 +323,7 @@ private void ProjectFields(IeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); return undefinedValue; } @@ -390,10 +346,10 @@ private void ProjectFields(IeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectFieldGettingFailed, fieldName, + string.Format(CommonStrings.Runtime_HostObjectFieldGettingFailed, fieldName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypeFieldGettingFailed, fieldName, typeName, + string.Format(CommonStrings.Runtime_HostTypeFieldGettingFailed, fieldName, typeName, exception.Message) ; errorValue = IeJsErrorHelpers.CreateError(errorMessage); @@ -419,7 +375,7 @@ private void ProjectFields(IeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectField, fieldName)); return undefinedValue; } @@ -443,10 +399,10 @@ private void ProjectFields(IeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectFieldSettingFailed, fieldName, + string.Format(CommonStrings.Runtime_HostObjectFieldSettingFailed, fieldName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypeFieldSettingFailed, fieldName, typeName, + string.Format(CommonStrings.Runtime_HostTypeFieldSettingFailed, fieldName, typeName, exception.Message) ; errorValue = IeJsErrorHelpers.CreateError(errorMessage); @@ -495,7 +451,7 @@ private void ProjectProperties(IeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); return undefinedValue; } @@ -518,10 +474,10 @@ private void ProjectProperties(IeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectPropertyGettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostObjectPropertyGettingFailed, propertyName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypePropertyGettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostTypePropertyGettingFailed, propertyName, typeName, exception.Message) ; errorValue = IeJsErrorHelpers.CreateError(errorMessage); @@ -550,7 +506,7 @@ private void ProjectProperties(IeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectProperty, propertyName)); return undefinedValue; } @@ -574,10 +530,10 @@ private void ProjectProperties(IeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectPropertySettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostObjectPropertySettingFailed, propertyName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypePropertySettingFailed, propertyName, + string.Format(CommonStrings.Runtime_HostTypePropertySettingFailed, propertyName, typeName, exception.Message) ; errorValue = IeJsErrorHelpers.CreateError(errorMessage); @@ -625,7 +581,7 @@ private void ProjectMethods(IeEmbeddedItem externalItem) if (instance && obj == null) { CreateAndSetTypeError(string.Format( - NetCoreStrings.Runtime_InvalidThisContextForHostObjectMethod, methodName)); + CommonStrings.Runtime_InvalidThisContextForHostObjectMethod, methodName)); return undefinedValue; } @@ -636,7 +592,7 @@ private void ProjectMethods(IeEmbeddedItem externalItem) if (bestFitMethod == null) { CreateAndSetReferenceError(string.Format( - NetCoreStrings.Runtime_SuitableMethodOfHostObjectNotFound, methodName)); + CommonStrings.Runtime_SuitableMethodOfHostObjectNotFound, methodName)); return undefinedValue; } @@ -661,10 +617,10 @@ private void ProjectMethods(IeEmbeddedItem externalItem) else { string errorMessage = instance ? - string.Format(NetCoreStrings.Runtime_HostObjectMethodInvocationFailed, methodName, + string.Format(CommonStrings.Runtime_HostObjectMethodInvocationFailed, methodName, exception.Message) : - string.Format(NetCoreStrings.Runtime_HostTypeMethodInvocationFailed, methodName, + string.Format(CommonStrings.Runtime_HostTypeMethodInvocationFailed, methodName, typeName, exception.Message) ; errorValue = IeJsErrorHelpers.CreateError(errorMessage); @@ -739,6 +695,5 @@ private static IeJsValue CreateErrorFromWrapperException(WrapperException except return errorValue; } -#endif } } \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs index 25ecc08..a4a50f6 100644 --- a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs @@ -1,18 +1,11 @@ using System; -#if !NETFRAMEWORK using System.Collections.Concurrent; -#endif using System.Linq; -#if !NETFRAMEWORK using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -#endif -#if !NETFRAMEWORK using MsieJavaScriptEngine.JsRt.Embedding; using MsieJavaScriptEngine.Utilities; -#endif namespace MsieJavaScriptEngine.JsRt { @@ -25,7 +18,6 @@ internal abstract class TypeMapper : IDisposable where TValue : struct where TFunction : Delegate { -#if !NETFRAMEWORK /// /// Name of property to store the external object /// @@ -74,23 +66,7 @@ internal abstract class TypeMapper : IDisposable /// /// Flag indicating whether this object is disposed /// - private readonly InterlockedStatedFlag _disposedFlag = new InterlockedStatedFlag(); -#else - /// - /// JS engine mode - /// - protected readonly JsEngineMode _engineMode; - - - /// - /// Constructs an instance of type mapper - /// - /// JS engine mode - protected TypeMapper(JsEngineMode engineMode) - { - _engineMode = engineMode; - } -#endif + private InterlockedStatedFlag _disposedFlag = new InterlockedStatedFlag(); /// @@ -98,7 +74,6 @@ protected TypeMapper(JsEngineMode engineMode) /// /// Instance of host type /// JavaScript value created from an host object -#if !NETFRAMEWORK public virtual TValue GetOrCreateScriptObject(object obj) { @@ -125,16 +100,12 @@ public virtual TValue GetOrCreateScriptObject(object obj) return embeddedObject.ScriptValue; } -#else - public abstract TValue GetOrCreateScriptObject(object obj); -#endif /// /// Creates a JavaScript value from an host type if the it does not already exist /// /// Host type /// JavaScript value created from an host type -#if !NETFRAMEWORK public virtual TValue GetOrCreateScriptType(Type type) { if (!_embeddedTypeStorageInitialized) @@ -160,9 +131,6 @@ public virtual TValue GetOrCreateScriptType(Type type) return embeddedType.ScriptValue; } -#else - public abstract TValue GetOrCreateScriptType(Type type); -#endif /// /// Makes a mapping of value from the host type to a script type @@ -177,7 +145,6 @@ public virtual TValue GetOrCreateScriptType(Type type) /// The source value /// The mapped value public abstract object MapToHostType(TValue value); -#if !NETFRAMEWORK protected abstract EmbeddedObject CreateEmbeddedObjectOrFunction(object obj); @@ -282,7 +249,6 @@ protected static Exception UnwrapException(Exception exception) return originalException; } -#endif #region IDisposable implementation @@ -291,7 +257,6 @@ protected static Exception UnwrapException(Exception exception) /// public virtual void Dispose() { -#if !NETFRAMEWORK if (_disposedFlag.Set()) { var lazyEmbeddedObjects = _lazyEmbeddedObjects; @@ -340,7 +305,6 @@ public virtual void Dispose() _embeddedTypeFinalizeCallback = null; } -#endif } #endregion diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 41be737..96ed984 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - Now a case-sensitive cultural postfixes are used in the names of `.resx` files. + In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no longer used for embedding objects and types. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs b/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs index 2a1e873..4d846c4 100644 --- a/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs +++ b/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs @@ -57,6 +57,14 @@ internal static CultureInfo Culture } } + /// + /// Looks up a localized string similar to "The parameter '{0}' must have a `{1}` type." + /// + internal static string Common_ArgumentHasIncorrectType + { + get { return GetString("Common_ArgumentHasIncorrectType"); } + } + /// /// Looks up a localized string similar to "The parameter '{0}' must be a non-empty string." /// @@ -241,6 +249,110 @@ internal static string Runtime_FunctionNotExist get { return GetString("Runtime_FunctionNotExist"); } } + /// + /// Looks up a localized string similar to "During invocation of the host delegate an error has occurred - “{0}”." + /// + internal static string Runtime_HostDelegateInvocationFailed + { + get { return GetString("Runtime_HostDelegateInvocationFailed"); } + } + + /// + /// Looks up a localized string similar to "During getting value of '{0}' field of the host object an error has occurred - “{1}”." + /// + internal static string Runtime_HostObjectFieldGettingFailed + { + get { return GetString("Runtime_HostObjectFieldGettingFailed"); } + } + + /// + /// Looks up a localized string similar to "During setting value of '{0}' field of the host object an error has occurred - “{1}”." + /// + internal static string Runtime_HostObjectFieldSettingFailed + { + get { return GetString("Runtime_HostObjectFieldSettingFailed"); } + } + + /// + /// Looks up a localized string similar to "During invocation of '{0}' method of the host object an error has occurred - “{1}”." + /// + internal static string Runtime_HostObjectMethodInvocationFailed + { + get { return GetString("Runtime_HostObjectMethodInvocationFailed"); } + } + + /// + /// Looks up a localized string similar to "During getting value of '{0}' property of the host object an error has occurred - “{1}”." + /// + internal static string Runtime_HostObjectPropertyGettingFailed + { + get { return GetString("Runtime_HostObjectPropertyGettingFailed"); } + } + + /// + /// Looks up a localized string similar to "During setting value of '{0}' property of the host object an error has occurred - “{1}”." + /// + internal static string Runtime_HostObjectPropertySettingFailed + { + get { return GetString("Runtime_HostObjectPropertySettingFailed"); } + } + + /// + /// Looks up a localized string similar to "During invocation of constructor of the `{0}` host type an error has occurred - “{1}”." + /// + internal static string Runtime_HostTypeConstructorInvocationFailed + { + get { return GetString("Runtime_HostTypeConstructorInvocationFailed"); } + } + + /// + /// Looks up a localized string similar to "Could not create instance of the `{0}` host type, because it does not have any public constructor." + /// + internal static string Runtime_HostTypeConstructorNotFound + { + get { return GetString("Runtime_HostTypeConstructorNotFound"); } + } + + /// + /// Looks up a localized string similar to "During getting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”." + /// + internal static string Runtime_HostTypeFieldGettingFailed + { + get { return GetString("Runtime_HostTypeFieldGettingFailed"); } + } + + /// + /// Looks up a localized string similar to "During setting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”." + /// + internal static string Runtime_HostTypeFieldSettingFailed + { + get { return GetString("Runtime_HostTypeFieldSettingFailed"); } + } + + /// + /// Looks up a localized string similar to "During invocation of '{0}' method of the `{1}` host type an error has occurred - “{2}”." + /// + internal static string Runtime_HostTypeMethodInvocationFailed + { + get { return GetString("Runtime_HostTypeMethodInvocationFailed"); } + } + + /// + /// Looks up a localized string similar to "During getting value of '{0}' property of the `{1}` host type an error has occurred - “{2}”." + /// + internal static string Runtime_HostTypePropertyGettingFailed + { + get { return GetString("Runtime_HostTypePropertyGettingFailed"); } + } + + /// + /// Looks up a localized string similar to "During setting value of '{0}' property of the host type `{1}` an error has occurred - “{2}”." + /// + internal static string Runtime_HostTypePropertySettingFailed + { + get { return GetString("Runtime_HostTypePropertySettingFailed"); } + } + /// /// Looks up a localized string similar to "The '{0}' line of the script call stack has an incorrect format." /// @@ -249,6 +361,30 @@ internal static string Runtime_InvalidCallStackLineFormat get { return GetString("Runtime_InvalidCallStackLineFormat"); } } + /// + /// Looks up a localized string similar to "Could not retrieve field '{0}' of the host object, because there was an invalid `this` context." + /// + internal static string Runtime_InvalidThisContextForHostObjectField + { + get { return GetString("Runtime_InvalidThisContextForHostObjectField"); } + } + + /// + /// Looks up a localized string similar to "Could not call method '{0}' of the host object, because there was an invalid `this` context." + /// + internal static string Runtime_InvalidThisContextForHostObjectMethod + { + get { return GetString("Runtime_InvalidThisContextForHostObjectMethod"); } + } + + /// + /// Looks up a localized string similar to "Could not retrieve property '{0}' of the host object, because there was an invalid `this` context." + /// + internal static string Runtime_InvalidThisContextForHostObjectProperty + { + get { return GetString("Runtime_InvalidThisContextForHostObjectProperty"); } + } + /// /// Looks up a localized string similar to "Script execution was interrupted." /// @@ -257,6 +393,22 @@ internal static string Runtime_ScriptInterrupted get { return GetString("Runtime_ScriptInterrupted"); } } + /// + /// Looks up a localized string similar to "Could not find suitable constructor or not enough arguments to invoke of constructor of the `{0}`..." + /// + internal static string Runtime_SuitableConstructorOfHostTypeNotFound + { + get { return GetString("Runtime_SuitableConstructorOfHostTypeNotFound"); } + } + + /// + /// Looks up a localized string similar to "Could not find suitable method or not enough arguments to invoke of '{0}' method of the host object." + /// + internal static string Runtime_SuitableMethodOfHostObjectNotFound + { + get { return GetString("Runtime_SuitableMethodOfHostObjectNotFound"); } + } + /// /// Looks up a localized string similar to "Сannot execute a '{0}' file, because it is empty." /// @@ -385,14 +537,6 @@ internal static string Usage_JsEnginesConflictInProcess get { return GetString("Usage_JsEnginesConflictInProcess"); } } - /// - /// Looks up a localized string similar to "It is prohibited to use the Chakra JsRT and Chakra ActiveScript engines on one machine at a time." - /// - internal static string Usage_JsEnginesConflictOnMachine - { - get { return GetString("Usage_JsEnginesConflictOnMachine"); } - } - /// /// Looks up a localized string similar to "The type of return value `{0}` is not supported." /// diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.resx b/src/MsieJavaScriptEngine/Resources/CommonStrings.resx index 4abc615..6f41f9e 100644 --- a/src/MsieJavaScriptEngine/Resources/CommonStrings.resx +++ b/src/MsieJavaScriptEngine/Resources/CommonStrings.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + The parameter '{0}' must have a `{1}` type. + The parameter '{0}' must be a non-empty string. @@ -186,12 +189,66 @@ The function with the name '{0}' does not exist. + + During invocation of the host delegate an error has occurred - “{0}”. + + + During getting value of '{0}' field of the host object an error has occurred - “{1}”. + + + During setting value of '{0}' field of the host object an error has occurred - “{1}”. + + + During invocation of '{0}' method of the host object an error has occurred - “{1}”. + + + During getting value of '{0}' property of the host object an error has occurred - “{1}”. + + + During setting value of '{0}' property of the host object an error has occurred - “{1}”. + + + During invocation of constructor of the `{0}` host type an error has occurred - “{1}”. + + + Could not create instance of the `{0}` host type, because it does not have any public constructor. + + + During getting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”. + + + During setting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”. + + + During invocation of '{0}' method of the `{1}` host type an error has occurred - “{2}”. + + + During getting value of '{0}' property of the `{1}` host type an error has occurred - “{2}”. + + + During setting value of '{0}' property of the host type `{1}` an error has occurred - “{2}”. + The '{0}' line of the script call stack has an incorrect format. + + Could not retrieve field '{0}' of the host object, because there was an invalid `this` context. + + + Could not call method '{0}' of the host object, because there was an invalid `this` context. + + + Could not retrieve property '{0}' of the host object, because there was an invalid `this` context. + Script execution was interrupted. + + Could not find suitable constructor or not enough arguments to invoke of constructor of the `{0}` host type. + + + Could not find suitable method or not enough arguments to invoke of '{0}' method of the host object. + Сannot execute a '{0}' file, because it is empty. @@ -240,9 +297,6 @@ It is prohibited to use the {0} and {1} engines in one process. - - It is prohibited to use the Chakra JsRT and Chakra ActiveScript engines on one machine at a time. - The type of return value `{0}` is not supported. diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.resx b/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.resx index 6e709db..76124ab 100644 --- a/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.resx +++ b/src/MsieJavaScriptEngine/Resources/CommonStrings.ru-RU.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Параметр с именем "{0}" должен иметь тип `{1}`! + Параметр с именем "{0}" не должен содержать пустую строку! @@ -186,12 +189,66 @@ Функция с именем "{0}" не существует! + + Во время вызова делегата хоста произошла ошибка - «{0}»! + + + Во время получения значения поля "{0}" объекта хоста произошла ошибка - «{1}»! + + + Во время присваивания значения полю "{0}" объекта хоста произошла ошибка - «{1}»! + + + Во время вызова метода "{0}" объекта хоста произошла ошибка - «{1}»! + + + Во время получения значения свойства "{0}" объекта хоста произошла ошибка - «{1}»! + + + Во время присваивания значения свойству "{0}" объекта хоста произошла ошибка - «{1}»! + + + Во время вызова конструктора типа хоста `{0}` произошла ошибка - «{1}»! + + + Не удается создать экземпляр типа хоста `{0}`, потому что он не имеет ни одного публичного конструктора! + + + Во время получения значения поля "{0}" типа хоста `{1}` произошла ошибка - «{2}»! + + + Во время присваивания значения полю "{0}" типа хоста `{1}` произошла ошибка - «{2}»! + + + Во время вызова метода "{0}" типа хоста `{1}` произошла ошибка - «{2}»! + + + Во время получения значения свойства "{0}" типа хоста `{1}` произошла ошибка - «{2}»! + + + Во время присваивания значения свойству "{0}" типа хоста `{1}` произошла ошибка - «{2}»! + Строка стека вызовов скрипта "{0}" имеет некорректный формат! + + Не удалось получить поле "{0}" объекта хоста, потому что контекст `this` недействителен! + + + Не удалось вызвать метод "{0}" объекта хоста, потому что контекст `this` недействителен! + + + Не удалось получить свойство "{0}" объекта хоста, потому что контекст `this` недействителен! + Выполнение скрипта было прервано! + + Не получается найти подходящий конструктор или не хватает аргументов для вызова конструктора `{0}` типа хоста! + + + Не получается найти подходящий метод или не хватает аргументов для вызова метода "{0}" объекта хоста! + Нельзя выполнить файл "{0}", потому что он пустой! @@ -240,9 +297,6 @@ Нельзя использовать {0} и {1} движки в одном процессе. - - Нельзя использовать Chakra JsRT и Chakra ActiveScript движки на одном компьютере одновременно. - Тип возвращаемого значения `{0}` не поддерживается! diff --git a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs index 8941c62..a115222 100644 --- a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs +++ b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs @@ -57,14 +57,6 @@ internal static CultureInfo Culture } } - /// - /// Looks up a localized string similar to "The parameter '{0}' must have a `{1}` type." - /// - internal static string Common_ArgumentHasIncorrectType - { - get { return GetString("Common_ArgumentHasIncorrectType"); } - } - /// /// Looks up a localized string similar to "Could not found none of the JavaScript engines, which would be compatible with .NET Core. Perhaps..." /// @@ -73,150 +65,6 @@ internal static string Engine_JsEnginesNotFound get { return GetString("Engine_JsEnginesNotFound"); } } - /// - /// Looks up a localized string similar to "During invocation of the host delegate an error has occurred - “{0}”." - /// - internal static string Runtime_HostDelegateInvocationFailed - { - get { return GetString("Runtime_HostDelegateInvocationFailed"); } - } - - /// - /// Looks up a localized string similar to "During getting value of '{0}' field of the host object an error has occurred - “{1}”." - /// - internal static string Runtime_HostObjectFieldGettingFailed - { - get { return GetString("Runtime_HostObjectFieldGettingFailed"); } - } - - /// - /// Looks up a localized string similar to "During setting value of '{0}' field of the host object an error has occurred - “{1}”." - /// - internal static string Runtime_HostObjectFieldSettingFailed - { - get { return GetString("Runtime_HostObjectFieldSettingFailed"); } - } - - /// - /// Looks up a localized string similar to "During invocation of '{0}' method of the host object an error has occurred - “{1}”." - /// - internal static string Runtime_HostObjectMethodInvocationFailed - { - get { return GetString("Runtime_HostObjectMethodInvocationFailed"); } - } - - /// - /// Looks up a localized string similar to "During getting value of '{0}' property of the host object an error has occurred - “{1}”." - /// - internal static string Runtime_HostObjectPropertyGettingFailed - { - get { return GetString("Runtime_HostObjectPropertyGettingFailed"); } - } - - /// - /// Looks up a localized string similar to "During setting value of '{0}' property of the host object an error has occurred - “{1}”." - /// - internal static string Runtime_HostObjectPropertySettingFailed - { - get { return GetString("Runtime_HostObjectPropertySettingFailed"); } - } - - /// - /// Looks up a localized string similar to "During invocation of constructor of the `{0}` host type an error has occurred - “{1}”." - /// - internal static string Runtime_HostTypeConstructorInvocationFailed - { - get { return GetString("Runtime_HostTypeConstructorInvocationFailed"); } - } - - /// - /// Looks up a localized string similar to "Could not create instance of the `{0}` host type, because it does not have any public constructor." - /// - internal static string Runtime_HostTypeConstructorNotFound - { - get { return GetString("Runtime_HostTypeConstructorNotFound"); } - } - - /// - /// Looks up a localized string similar to "During getting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”." - /// - internal static string Runtime_HostTypeFieldGettingFailed - { - get { return GetString("Runtime_HostTypeFieldGettingFailed"); } - } - - /// - /// Looks up a localized string similar to "During setting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”." - /// - internal static string Runtime_HostTypeFieldSettingFailed - { - get { return GetString("Runtime_HostTypeFieldSettingFailed"); } - } - - /// - /// Looks up a localized string similar to "During invocation of '{0}' method of the `{1}` host type an error has occurred - “{2}”." - /// - internal static string Runtime_HostTypeMethodInvocationFailed - { - get { return GetString("Runtime_HostTypeMethodInvocationFailed"); } - } - - /// - /// Looks up a localized string similar to "During getting value of '{0}' property of the `{1}` host type an error has occurred - “{2}”." - /// - internal static string Runtime_HostTypePropertyGettingFailed - { - get { return GetString("Runtime_HostTypePropertyGettingFailed"); } - } - - /// - /// Looks up a localized string similar to "During setting value of '{0}' property of the host type `{1}` an error has occurred - “{2}”." - /// - internal static string Runtime_HostTypePropertySettingFailed - { - get { return GetString("Runtime_HostTypePropertySettingFailed"); } - } - - /// - /// Looks up a localized string similar to "Could not retrieve field '{0}' of the host object, because there was an invalid `this` context." - /// - internal static string Runtime_InvalidThisContextForHostObjectField - { - get { return GetString("Runtime_InvalidThisContextForHostObjectField"); } - } - - /// - /// Looks up a localized string similar to "Could not call method '{0}' of the host object, because there was an invalid `this` context." - /// - internal static string Runtime_InvalidThisContextForHostObjectMethod - { - get { return GetString("Runtime_InvalidThisContextForHostObjectMethod"); } - } - - /// - /// Looks up a localized string similar to "Could not retrieve property '{0}' of the host object, because there was an invalid `this` context." - /// - internal static string Runtime_InvalidThisContextForHostObjectProperty - { - get { return GetString("Runtime_InvalidThisContextForHostObjectProperty"); } - } - - /// - /// Looks up a localized string similar to "Could not find suitable constructor or not enough arguments to invoke of constructor of the `{0}`..." - /// - internal static string Runtime_SuitableConstructorOfHostTypeNotFound - { - get { return GetString("Runtime_SuitableConstructorOfHostTypeNotFound"); } - } - - /// - /// Looks up a localized string similar to "Could not find suitable method or not enough arguments to invoke of '{0}' method of the host object." - /// - internal static string Runtime_SuitableMethodOfHostObjectNotFound - { - get { return GetString("Runtime_SuitableMethodOfHostObjectNotFound"); } - } - /// /// Looks up a localized string similar to "The '{0}' mode of JavaScript engine is not compatible with .NET Core." /// diff --git a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.resx b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.resx index 532bf65..e969324 100644 --- a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.resx +++ b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.resx @@ -117,66 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - The parameter '{0}' must have a `{1}` type. - Could not found none of the JavaScript engines, which would be compatible with .NET Core. Perhaps you have not installed the Microsoft Edge Legacy or Internet Explorer 11 browser. - - During invocation of the host delegate an error has occurred - “{0}”. - - - During getting value of '{0}' field of the host object an error has occurred - “{1}”. - - - During setting value of '{0}' field of the host object an error has occurred - “{1}”. - - - During invocation of '{0}' method of the host object an error has occurred - “{1}”. - - - During getting value of '{0}' property of the host object an error has occurred - “{1}”. - - - During setting value of '{0}' property of the host object an error has occurred - “{1}”. - - - During invocation of constructor of the `{0}` host type an error has occurred - “{1}”. - - - Could not create instance of the `{0}` host type, because it does not have any public constructor. - - - During getting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”. - - - During setting value of '{0}' field of the `{1}` host type an error has occurred - “{2}”. - - - During invocation of '{0}' method of the `{1}` host type an error has occurred - “{2}”. - - - During getting value of '{0}' property of the `{1}` host type an error has occurred - “{2}”. - - - During setting value of '{0}' property of the host type `{1}` an error has occurred - “{2}”. - - - Could not retrieve field '{0}' of the host object, because there was an invalid `this` context. - - - Could not call method '{0}' of the host object, because there was an invalid `this` context. - - - Could not retrieve property '{0}' of the host object, because there was an invalid `this` context. - - - Could not find suitable constructor or not enough arguments to invoke of constructor of the `{0}` host type. - - - Could not find suitable method or not enough arguments to invoke of '{0}' method of the host object. - The '{0}' mode of JavaScript engine is not compatible with .NET Core. diff --git a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-ru.Designer.cs b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-RU.Designer.cs similarity index 100% rename from src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-ru.Designer.cs rename to src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-RU.Designer.cs diff --git a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-ru.resx b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-RU.resx similarity index 56% rename from src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-ru.resx rename to src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-RU.resx index 4b06f90..5835a08 100644 --- a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-ru.resx +++ b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.ru-RU.resx @@ -117,66 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Параметр с именем "{0}" должен иметь тип `{1}`! - Не удалось найти ни один из JavaScript-движков, который был бы совместим с .NET Core! Возможно, на вашем компьютере не установлен браузер Microsoft Edge Legacy или Internet Explorer 11. - - Во время вызова делегата хоста произошла ошибка - «{0}»! - - - Во время получения значения поля "{0}" объекта хоста произошла ошибка - «{1}»! - - - Во время присваивания значения полю "{0}" объекта хоста произошла ошибка - «{1}»! - - - Во время вызова метода "{0}" объекта хоста произошла ошибка - «{1}»! - - - Во время получения значения свойства "{0}" объекта хоста произошла ошибка - «{1}»! - - - Во время присваивания значения свойству "{0}" объекта хоста произошла ошибка - «{1}»! - - - Во время вызова конструктора типа хоста `{0}` произошла ошибка - «{1}»! - - - Не удается создать экземпляр типа хоста `{0}`, потому что он не имеет ни одного публичного конструктора! - - - Во время получения значения поля "{0}" типа хоста `{1}` произошла ошибка - «{2}»! - - - Во время присваивания значения полю "{0}" типа хоста `{1}` произошла ошибка - «{2}»! - - - Во время вызова метода "{0}" типа хоста `{1}` произошла ошибка - «{2}»! - - - Во время получения значения свойства "{0}" типа хоста `{1}` произошла ошибка - «{2}»! - - - Во время присваивания значения свойству "{0}" типа хоста `{1}` произошла ошибка - «{2}»! - - - Не удалось получить поле "{0}" объекта хоста, потому что контекст `this` недействителен! - - - Не удалось вызвать метод "{0}" объекта хоста, потому что контекст `this` недействителен! - - - Не удалось получить свойство "{0}" объекта хоста, потому что контекст `this` недействителен! - - - Не получается найти подходящий конструктор или не хватает аргументов для вызова конструктора `{0}` типа хоста! - - - Не получается найти подходящий метод или не хватает аргументов для вызова метода "{0}" объекта хоста! - Режим JavaScript-движка "{0}" не совместим с .NET Core! diff --git a/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-RU.Designer.cs b/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-RU.Designer.cs new file mode 100644 index 0000000..e69de29 diff --git a/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-ru.resx b/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-RU.resx similarity index 100% rename from src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-ru.resx rename to src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-RU.resx diff --git a/src/MsieJavaScriptEngine/Utilities/Utils.cs b/src/MsieJavaScriptEngine/Utilities/Utils.cs index 15979a2..96ff86e 100644 --- a/src/MsieJavaScriptEngine/Utilities/Utils.cs +++ b/src/MsieJavaScriptEngine/Utilities/Utils.cs @@ -26,50 +26,6 @@ public static bool Is64BitProcess() return is64Bit; } - /// - /// Gets a content of the embedded resource as string - /// - /// The case-sensitive resource name without the namespace of the specified type - /// The type, that determines the assembly and whose namespace is used to scope - /// the resource name - /// Сontent of the embedded resource as string - public static string GetResourceAsString(string resourceName, Type type) - { - if (resourceName == null) - { - throw new ArgumentNullException( - nameof(resourceName), - string.Format(CommonStrings.Common_ArgumentIsNull, nameof(resourceName)) - ); - } - - if (type == null) - { - throw new ArgumentNullException( - nameof(type), - string.Format(CommonStrings.Common_ArgumentIsNull, nameof(type)) - ); - } - - if (string.IsNullOrWhiteSpace(resourceName)) - { - throw new ArgumentException( - string.Format(CommonStrings.Common_ArgumentIsEmpty, nameof(resourceName)), - nameof(resourceName) - ); - } - -#if NET40 - Assembly assembly = type.Assembly; -#else - Assembly assembly = type.GetTypeInfo().Assembly; -#endif - string nameSpace = type.Namespace; - string resourceFullName = nameSpace != null ? nameSpace + "." + resourceName : resourceName; - - return InnerGetResourceAsString(resourceFullName, assembly); - } - /// /// Gets a content of the embedded resource as string /// @@ -102,11 +58,6 @@ public static string GetResourceAsString(string resourceName, Assembly assembly) ); } - return InnerGetResourceAsString(resourceName, assembly); - } - - private static string InnerGetResourceAsString(string resourceName, Assembly assembly) - { using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { if (stream == null) diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index cc7c084..8599766 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,7 +21,8 @@ ============= RELEASE NOTES ============= - Now a case-sensitive cultural postfixes are used in the names of `.resx` files. + In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no + longer used for embedding objects and types. ============ PROJECT SITE diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs index 35e22de..65bca83 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs @@ -14,7 +14,6 @@ public class InteropTests : InteropTestsBase #region Embedding of objects -#if NETCOREAPP #region Delegates @@ -97,7 +96,6 @@ public void MappingRuntimeErrorDuringRecursiveEvaluationOfFiles() #endregion -#endif #endregion } } \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs index c4cf210..3d06904 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs @@ -14,7 +14,6 @@ public class InteropTests : InteropTestsBase #region Embedding of objects -#if NETCOREAPP #region Delegates @@ -97,7 +96,6 @@ public void MappingRuntimeErrorDuringRecursiveEvaluationOfFiles() #endregion -#endif #endregion } } \ No newline at end of file From 2ad66f09085de66cb07038d4cc713a728c5784b3 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 6 Feb 2023 17:44:43 +0300 Subject: [PATCH 08/28] Reformatted a XML documentation comments --- .../ActiveScript/ActiveScriptException.cs | 4 +-- .../ActiveScript/ActiveScriptJsEngineBase.cs | 8 ++--- .../ActiveScriptJsErrorHelpers.cs | 4 +-- .../ActiveScript/ActiveScriptWrapper32.cs | 3 +- .../ActiveScript/ActiveScriptWrapper64.cs | 3 +- .../ActiveScript/ActiveScriptWrapperBase.cs | 11 +++--- .../ChakraActiveScriptJsEngine.cs | 2 +- .../ClassicActiveScriptJsEngine.cs | 2 +- .../Debugging/DebugApplicationWrapper.cs | 2 +- .../Debugging/DebugStackFrameDescriptor.cs | 2 +- .../Debugging/IActiveScriptDebug32.cs | 2 +- .../Debugging/IActiveScriptDebug64.cs | 2 +- .../Debugging/IActiveScriptSiteDebug32.cs | 2 +- .../Debugging/IDebugApplication32.cs | 12 +++---- .../Debugging/IDebugApplication64.cs | 12 +++---- .../Debugging/IDebugDocumentHelper32.cs | 4 +-- .../Debugging/IDebugDocumentHelper64.cs | 4 +-- .../Debugging/IDebugDocumentText.cs | 10 +++--- .../Debugging/IDebugStackFrame.cs | 8 ++--- .../Debugging/IDebugThreadCall32.cs | 2 +- .../Debugging/IDebugThreadCall64.cs | 2 +- .../Debugging/IEnumDebugExpressionContexts.cs | 2 +- .../Debugging/ProcessDebugManagerWrapper.cs | 4 +-- .../ActiveScript/Debugging/SourceTextAttrs.cs | 8 ++--- .../ActiveScript/IActiveScript.cs | 12 +++---- .../ActiveScript/IActiveScriptError.cs | 2 +- .../ActiveScript/IActiveScriptParse32.cs | 34 +++++++++--------- .../ActiveScript/IActiveScriptParse64.cs | 34 +++++++++--------- .../ActiveScript/IActiveScriptProperty.cs | 4 +-- .../ActiveScript/IActiveScriptSite.cs | 22 ++++++------ .../IActiveScriptSiteInterruptPoll.cs | 2 +- .../ActiveScript/IActiveScriptWrapper.cs | 8 ++--- .../ActiveScript/JScriptRuntimeErrorNumber.cs | 6 ++-- .../ActiveScript/JScriptSyntaxErrorNumber.cs | 34 +++++++++--------- .../ActiveScript/ScriptInfoFlags.cs | 4 +-- .../ActiveScript/ScriptItemFlags.cs | 6 ++-- .../ActiveScript/ScriptProperty.cs | 2 +- .../ActiveScript/ScriptState.cs | 8 ++--- .../ActiveScript/ScriptTextFlags.cs | 2 +- .../Extensions/StringExtensions.cs | 4 +-- .../Helpers/ReflectionHelpers.cs | 2 +- .../Helpers/ValidationHelpers.cs | 8 ++--- src/MsieJavaScriptEngine/IInnerJsEngine.cs | 2 +- src/MsieJavaScriptEngine/JsEngineSettings.cs | 2 +- .../JsRt/Edge/ChakraEdgeJsRtJsEngine.cs | 7 ++-- .../JsRt/Edge/EdgeJsContext.cs | 4 +-- .../JsRt/Edge/EdgeJsErrorHelpers.cs | 12 +++---- .../JsRt/Edge/EdgeJsNativeFunction.cs | 2 +- .../JsRt/Edge/EdgeJsRuntime.cs | 6 ++-- .../JsRt/Edge/EdgeJsValue.cs | 36 +++++++++---------- .../JsRt/Ie/ChakraIeJsRtJsEngine.cs | 7 ++-- .../JsRt/Ie/IeJsContext.cs | 4 +-- .../JsRt/Ie/IeJsErrorHelpers.cs | 12 +++---- .../JsRt/Ie/IeJsNativeFunction.cs | 2 +- .../JsRt/Ie/IeJsRuntime.cs | 6 ++-- src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs | 34 +++++++++--------- .../JsRt/JsBeforeCollectCallback.cs | 2 +- src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs | 4 +-- .../JsRt/JsMemoryAllocationCallback.cs | 6 ++-- .../JsRt/JsRuntimeAttributes.cs | 2 +- .../JsRt/JsThreadServiceCallback.cs | 2 +- src/MsieJavaScriptEngine/JsRt/JsValueType.cs | 14 ++++---- src/MsieJavaScriptEngine/MsieJsEngine.cs | 2 +- src/MsieJavaScriptEngine/ScriptDispatcher.cs | 4 +-- src/MsieJavaScriptEngine/Undefined.cs | 4 +-- .../Utilities/TypeConverter.cs | 8 ++--- src/MsieJavaScriptEngine/Utilities/Utils.cs | 2 +- 67 files changed, 245 insertions(+), 250 deletions(-) diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs index fc0fd68..be86036 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptException.cs @@ -9,7 +9,7 @@ namespace MsieJavaScriptEngine.ActiveScript public sealed class ActiveScriptException : Exception { /// - /// The HRESULT of the error + /// The HRESULT of the error /// private int _errorCode; @@ -54,7 +54,7 @@ public sealed class ActiveScriptException : Exception private string _sourceFragment = string.Empty; /// - /// Gets or sets a HRESULT of the error + /// Gets or sets a HRESULT of the error /// public int ErrorCode { diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs index 54661bb..1b71fa8 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs @@ -184,7 +184,7 @@ protected ActiveScriptJsEngineBase(JsEngineSettings settings, string clsid, /// Initializes a script dispatcher /// /// The maximum stack size, in bytes, to be used by the thread, - /// or 0 to use the default maximum stack size specified in the header for the executable. + /// or 0 to use the default maximum stack size specified in the header for the executable. private static void InitScriptDispatcher(int maxStackSize) { if (_dispatcher != null) @@ -209,7 +209,7 @@ private static void InitScriptDispatcher(int maxStackSize) /// CLSID of JS engine /// Flag indicating whether this JS engine is supported /// Support synchronizer - /// Result of check (true - supports; false - does not support) + /// Result of check (true - supports; false - does not support) protected static bool IsSupported(string clsid, ref bool? isSupported, ref object supportSynchronizer) { if (isSupported.HasValue) @@ -315,7 +315,7 @@ protected virtual void InitScriptContext() } /// - /// Gets and resets a last exception. Returns null for none. + /// Gets and resets a last exception. Returns null for none. /// private ActiveScriptException GetAndResetLastException() { @@ -417,7 +417,7 @@ private void InnerExecuteResource(string resourceName, Assembly assembly) /// Script text /// Application specific source context /// Debug document - /// Result of creating a debug document (true - is created; false - is not created) + /// Result of creating a debug document (true - is created; false - is not created) private bool TryCreateDebugDocument(string name, string code, out UIntPtr sourceContext, out DebugDocument document) { diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs index f455f67..92fef49 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsErrorHelpers.cs @@ -16,7 +16,7 @@ internal static class ActiveScriptJsErrorHelpers /// Checks whether the specified error number is compilation error /// /// Error number - /// Result of check (true - is compilation error; false - is not compilation error) + /// Result of check (true - is compilation error; false - is not compilation error) public static bool IsCompilationError(int errorNumber) { bool result = errorNumber >= JScriptSyntaxErrorNumber.SyntaxError @@ -29,7 +29,7 @@ public static bool IsCompilationError(int errorNumber) /// Checks whether the specified error number is runtime error /// /// Error number - /// Result of check (true - is runtime error; false - is not runtime error) + /// Result of check (true - is runtime error; false - is not runtime error) public static bool IsRuntimeError(int errorNumber) { bool result = errorNumber == JScriptRuntimeErrorNumber.OutOfStackSpace || (errorNumber >= JScriptRuntimeErrorNumber.CannotAssignToThisKeyword diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs index 0bf3a3e..6893c38 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper32.cs @@ -142,8 +142,7 @@ public override void Dispose() /// /// Destroys object /// - /// Flag, allowing destruction of - /// managed objects contained in fields of class + /// Flag, allowing destruction of managed objects contained in fields of class protected override void Dispose(bool disposing) { if (disposing) diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs index a360bdf..bd849b9 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapper64.cs @@ -142,8 +142,7 @@ public override void Dispose() /// /// Destroys object /// - /// Flag, allowing destruction of - /// managed objects contained in fields of class + /// Flag, allowing destruction of managed objects contained in fields of class protected override void Dispose(bool disposing) { if (disposing) diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs index 2db2dd5..0aa68be 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptWrapperBase.cs @@ -151,11 +151,11 @@ public object GetScriptDispatch() /// The scriptlet text to evaluate. The interpretation of this /// string depends on the scripting language /// The item name that gives the context in which the - /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated + /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated /// in the scripting engine's global context /// The context object. This object is reserved for use in a /// debugging environment, where such a context may be provided by the debugger to - /// represent an active run-time context. If this parameter is null, the engine + /// represent an active run-time context. If this parameter is null, the engine /// uses to identify the context. /// The end-of-scriptlet delimiter. When /// is parsed from a stream of text, the host typically uses a delimiter, such as two @@ -164,14 +164,14 @@ public object GetScriptDispatch() /// some conditional primitive preprocessing (for example, replacing a single quotation /// mark ['] with two single quotation marks for use as a delimiter). Exactly how /// (and if) the scripting engine makes use of this information depends on the - /// scripting engine. Set this parameter to null if the host did not use a delimiter + /// scripting engine. Set this parameter to null if the host did not use a delimiter /// to mark the end of the scriptlet. /// Application-defined value that is used for /// debugging purposes /// Zero-based value that specifies which line the /// parsing will begin at /// Flags associated with the scriptlet - /// The results of scriptlet processing, or null if the caller expects no + /// The results of scriptlet processing, or null if the caller expects no /// result (that is, the value is not set) public abstract object ParseScriptText(string code, string itemName, object context, string delimiter, UIntPtr sourceContextCookie, uint startingLineNumber, ScriptTextFlags flags); @@ -240,8 +240,7 @@ public void CollectGarbage(ScriptGCType type) /// /// Destroys object /// - /// Flag, allowing destruction of - /// managed objects contained in fields of class + /// Flag, allowing destruction of managed objects contained in fields of class protected virtual void Dispose(bool disposing) { if (disposing) diff --git a/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs b/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs index c9bbf35..21f1034 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ChakraActiveScriptJsEngine.cs @@ -72,7 +72,7 @@ public ChakraActiveScriptJsEngine(JsEngineSettings settings) /// /// Checks a support of the Chakra Active Script engine on the machine /// - /// Result of check (true - supports; false - does not support) + /// Result of check (true - supports; false - does not support) public static bool IsSupported() { bool isSupported = IsSupported(ClassId.Chakra, ref _isSupported, ref _supportSynchronizer); diff --git a/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs b/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs index be28650..cfe4aec 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ClassicActiveScriptJsEngine.cs @@ -74,7 +74,7 @@ public ClassicActiveScriptJsEngine(JsEngineSettings settings) /// /// Checks a support of the Classic Active Script engine on the machine /// - /// Result of check (true - supports; false - does not support) + /// Result of check (true - supports; false - does not support) public static bool IsSupported() { bool isSupported = IsSupported(ClassId.Classic, ref _isSupported, ref _supportSynchronizer); diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs index 16cdea9..e58dd18 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugApplicationWrapper.cs @@ -112,7 +112,7 @@ public void CreateApplicationNode(out IDebugApplicationNode node) /// Returns the current debugger connected to the application /// /// The current debugger connected to the application - /// The method returns an HRESULT + /// The method returns an HRESULT public uint GetDebugger(out IApplicationDebugger debugger) { uint result = _is64Bit ? diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs index d5df6d2..45d2e46 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs @@ -38,7 +38,7 @@ internal struct DebugStackFrameDescriptor public bool IsFinal; /// - /// If this parameter is not null, the current enumerator merging should stop and + /// If this parameter is not null, the current enumerator merging should stop and /// a new one should be started. The object indicates how to start the new enumeration. /// public IntPtr pFinalObject; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs index e915cfe..21c2a6e 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug32.cs @@ -53,7 +53,7 @@ [In] [Out] ref IntPtr pAttrs /// Character offset relative to start of script text /// Number of characters in this context /// An enumerator of the code contexts in the specified range - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint EnumCodeContextsOfPosition( [In] uint sourceContext, diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs index 8ee47fc..0a23f42 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptDebug64.cs @@ -53,7 +53,7 @@ [In] [Out] ref IntPtr pAttrs /// Character offset relative to start of script text /// Number of characters in this context /// An enumerator of the code contexts in the specified range - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint EnumCodeContextsOfPosition( [In] ulong sourceContext, diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs index bf43783..a7c0618 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IActiveScriptSiteDebug32.cs @@ -13,7 +13,7 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging internal interface IActiveScriptSiteDebug32 { /// - /// Used by the language engine to delegate IDebugCodeContext.GetSourceContext + /// Used by the language engine to delegate /// /// The source context as provided to /// or diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs index 6f11a2b..87a78c3 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication32.cs @@ -48,7 +48,7 @@ [In] [MarshalAs(UnmanagedType.Interface)] IApplicationDebugger debugger /// Returns the current debugger connected to the application /// /// The current debugger connected to the application - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint GetDebugger( [Out] [MarshalAs(UnmanagedType.Interface)] out IApplicationDebugger debugger @@ -207,7 +207,7 @@ [In] uint cookie /// /// Determines if the current running thread is the debugger thread /// - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint QueryCurrentThreadIsDebuggerThread(); @@ -251,7 +251,7 @@ [In] [MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)] object eventObje /// Action to take when the debugger resumes the application /// Action to take when the debugger resumes the application /// if there is an error - /// Flag which is true if the engine should call + /// Flag which is true if the engine should call /// the method void HandleRuntimeError( [In] [MarshalAs(UnmanagedType.Interface)] IActiveScriptErrorDebug errorDebug, @@ -264,8 +264,8 @@ [Out] [MarshalAs(UnmanagedType.Bool)] out bool callOnScriptError /// /// Determines if a JIT debugger is registered /// - /// If the method succeeds and a JIT debugger is registered, the method returns true. - /// Otherwise, it returns false. + /// If the method succeeds and a JIT debugger is registered, the method returns true. + /// Otherwise, it returns false. [PreserveSig] [return: MarshalAs(UnmanagedType.Bool)] bool FCanJitDebug(); @@ -274,7 +274,7 @@ [Out] [MarshalAs(UnmanagedType.Bool)] out bool callOnScriptError /// Determines if a JIT debugger is registered to auto-debug dumb hosts /// /// If the method succeeds and a JIT debugger is registered to auto-debug dumb hosts, - /// the method returns true. Otherwise, it returns false. + /// the method returns true. Otherwise, it returns false. [PreserveSig] [return: MarshalAs(UnmanagedType.Bool)] bool FIsAutoJitDebugEnabled(); diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs index 036edc0..6f1993c 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugApplication64.cs @@ -48,7 +48,7 @@ [In] [MarshalAs(UnmanagedType.Interface)] IApplicationDebugger debugger /// Returns the current debugger connected to the application /// /// The current debugger connected to the application - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint GetDebugger( [Out] [MarshalAs(UnmanagedType.Interface)] out IApplicationDebugger debugger @@ -207,7 +207,7 @@ [In] uint cookie /// /// Determines if the current running thread is the debugger thread /// - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint QueryCurrentThreadIsDebuggerThread(); @@ -251,7 +251,7 @@ [In] [MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)] object eventObje /// Action to take when the debugger resumes the application /// Action to take when the debugger resumes the application /// if there is an error - /// Flag which is true if the engine should call + /// Flag which is true if the engine should call /// the method void HandleRuntimeError( [In] [MarshalAs(UnmanagedType.Interface)] IActiveScriptErrorDebug errorDebug, @@ -264,8 +264,8 @@ [Out] [MarshalAs(UnmanagedType.Bool)] out bool callOnScriptError /// /// Determines if a JIT debugger is registered /// - /// If the method succeeds and a JIT debugger is registered, the method returns true. - /// Otherwise, it returns false. + /// If the method succeeds and a JIT debugger is registered, the method returns true. + /// Otherwise, it returns false. [PreserveSig] [return: MarshalAs(UnmanagedType.Bool)] bool FCanJitDebug(); @@ -274,7 +274,7 @@ [Out] [MarshalAs(UnmanagedType.Bool)] out bool callOnScriptError /// Determines if a JIT debugger is registered to auto-debug dumb hosts /// /// If the method succeeds and a JIT debugger is registered to auto-debug dumb hosts, - /// the method returns true. Otherwise, it returns false. + /// the method returns true. Otherwise, it returns false. [PreserveSig] [return: MarshalAs(UnmanagedType.Bool)] bool FIsAutoJitDebugEnabled(); diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper32.cs index 59ebb17..958df77 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper32.cs @@ -4,8 +4,8 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// /// Provide implementations for many interfaces necessary for smart hosting, such as - /// the IDebugDocument, IDebugDocumentContext, IDebugDocumentProvider, IDebugDocumentText - /// and IDebugDocumentTextEvents interfaces + /// the IDebugDocument, IDebugDocumentContext, IDebugDocumentProvider, + /// IDebugDocumentText and IDebugDocumentTextEvents interfaces /// [ComImport] [Guid("51973C26-CB0C-11d0-B5C9-00A0244A0E7A")] diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper64.cs index c94ab07..4925b95 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentHelper64.cs @@ -4,8 +4,8 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// /// Provide implementations for many interfaces necessary for smart hosting, such as - /// the IDebugDocument, IDebugDocumentContext, IDebugDocumentProvider, IDebugDocumentText - /// and IDebugDocumentTextEvents interfaces + /// the IDebugDocument, IDebugDocumentContext, IDebugDocumentProvider, + /// IDebugDocumentText and IDebugDocumentTextEvents interfaces /// [ComImport] [Guid("c4c7363c-20fd-47f9-bd82-4855e0150871")] diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs index c652344..af74329 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugDocumentText.cs @@ -49,9 +49,9 @@ [Out] out TextDocAttrs attrs /// /// Returns the number of lines and number of characters in the document /// - /// Number of lines in the document. If this parameter is null, + /// Number of lines in the document. If this parameter is null, /// the method does not return a value - /// Number of characters in the document. If this parameter is null, + /// Number of characters in the document. If this parameter is null, /// the method does not return a value void GetSize( [Out] out uint numLines, @@ -76,7 +76,7 @@ [Out] out uint position /// Start location of the character position range /// The line number of the range /// The character offset of the range within line . - /// If this parameter is null, the method does not return a value + /// If this parameter is null, the method does not return a value void GetLineOfPosition( [In] uint position, [Out] out uint lineNumber, @@ -88,9 +88,9 @@ [Out] out uint offsetInLine /// /// Start location of the character position range /// A character text buffer. The buffer must be large enough to hold - /// characters. If this parameter is null, the method does not return characters. + /// characters. If this parameter is null, the method does not return characters. /// A character attribute buffer. The buffer must be large enough to hold - /// characters. If this parameter is null, the method does not return attributes. + /// characters. If this parameter is null, the method does not return attributes. /// The number of characters/attributes returned. This parameter must be set to /// zero before calling this method. /// Number of characters in the character position range. Also specifies diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs index 6e65835..9c62495 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugStackFrame.cs @@ -22,8 +22,8 @@ [Out] [MarshalAs(UnmanagedType.Interface)] out IDebugCodeContext context /// /// Returns a short or long textual description of the stack frame /// - /// Flag, where true returns a long description and - /// false returns a short description + /// Flag, where true returns a long description and + /// false returns a short description /// The description of the stack frame void GetDescriptionString( [In] [MarshalAs(UnmanagedType.Bool)] bool longString, @@ -33,8 +33,8 @@ [Out] [MarshalAs(UnmanagedType.BStr)] out string description /// /// Returns a short or long textual description of the language /// - /// Flag, where true returns a long description and - /// false returns a short description + /// Flag, where true returns a long description and + /// false returns a short description /// The description of the language void GetLanguageString( [In] [MarshalAs(UnmanagedType.Bool)] bool longString, diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs index 642367b..270c035 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall32.cs @@ -5,7 +5,7 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// /// The interface is typically implemented by a component that makes - /// cross-thread calls with the IDebugThread marshalling implementation provided by + /// cross-thread calls with the IDebugThread marshalling implementation provided by /// the process debug manager (PDM). /// [ComImport] diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs index 8c63485..2a87b8e 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IDebugThreadCall64.cs @@ -5,7 +5,7 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// /// The interface is typically implemented by a component that makes - /// cross-thread calls with the IDebugThread marshalling implementation provided by + /// cross-thread calls with the IDebugThread marshalling implementation provided by /// the process debug manager (PDM). /// [ComImport] diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs index 00f7d49..fcc7d9d 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/IEnumDebugExpressionContexts.cs @@ -4,7 +4,7 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging { /// - /// Enumerates a collection of IDebugExpressionContexts objects + /// Enumerates a collection of IDebugExpressionContexts objects /// [ComImport] [Guid("51973c40-cb0c-11d0-b5c9-00a0244a0e7a")] diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs index 3cd1459..8ae8f24 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/ProcessDebugManagerWrapper.cs @@ -51,7 +51,7 @@ public ProcessDebugManagerWrapper(IProcessDebugManager64 processDebugManager) /// the creation succeeded. /// /// Wrapper for process debug manager - /// true if the wrapper was created successfully; otherwise, false. + /// true if the wrapper was created successfully; otherwise, false. public static bool TryCreate(out ProcessDebugManagerWrapper wrapper) { const string progId = "ProcessDebugManager"; @@ -104,7 +104,7 @@ public void CreateApplication(out DebugApplicationWrapper applicationWrapper) /// /// Wrapper for debug application /// An engine-defined cookie - /// true if the debug application was added successfully; otherwise, false. + /// true if the debug application was added successfully; otherwise, false. public bool TryAddApplication(DebugApplicationWrapper applicationWrapper, out uint cookie) { uint result; diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs index b86ee0a..149e0d2 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/SourceTextAttrs.cs @@ -13,7 +13,7 @@ internal enum SourceTextAttrs : ushort /// /// The character is part of a language keyword - /// (for example, the JavaScript keyword while) + /// (for example, the JavaScript keyword while) /// Keyword = 0x0001, @@ -30,19 +30,19 @@ internal enum SourceTextAttrs : ushort /// /// The character is part of a language operator - /// (for example, the arithmetic operator +) + /// (for example, the arithmetic operator +) /// Operator = 0x0008, /// /// The character is part of a language numeric constant - /// (for example, the constant 3.14159) + /// (for example, the constant 3.14159) /// Number = 0x0010, /// /// The character is part of a language string constant - /// (for example, the string "Hello World") + /// (for example, the string "Hello World") /// String = 0x0020, diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs index cdee6c9..4ce72e2 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScript.cs @@ -84,8 +84,8 @@ [In] ScriptItemFlags flags /// /// Adds a type library to the name space for the script. This is similar to the - /// #include directive in C/C++. It allows a set of predefined items such as - /// class definitions, typedefs, and named constants to be added to the run-time + /// #include directive in C/C++. It allows a set of predefined items such as + /// class definitions, typedefs, and named constants to be added to the run-time /// environment available to the script. /// /// CLSID of the type library to add @@ -100,16 +100,16 @@ [In] ScriptTypeLibFlags typeLibFlags ); /// - /// Retrieves the IDispatch interface for the methods and properties associated + /// Retrieves the IDispatch interface for the methods and properties associated /// with the currently running script /// /// The name of the item for which the caller needs the associated - /// dispatch object. If this parameter is null, the dispatch object contains as its members + /// dispatch object. If this parameter is null, the dispatch object contains as its members /// all of the global methods and properties defined by the script. Through the - /// IDispatch interface and the associated interface, + /// IDispatch interface and the associated interface, /// the host can invoke script methods or view and modify script variables. /// The object associated with the script's global methods and - /// properties. If the scripting engine does not support such an object, null is returned. + /// properties. If the scripting engine does not support such an object, null is returned. void GetScriptDispatch( [In] [MarshalAs(UnmanagedType.LPWStr)] string itemName, [Out] [MarshalAs(UnmanagedType.IDispatch)] out object dispatch diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs index e009f67..10d8244 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptError.cs @@ -19,7 +19,7 @@ internal interface IActiveScriptError /// Retrieves information about an error that occurred while the scripting engine was running /// a script /// - /// An EXCEPINFO structure that receives error information + /// An EXCEPINFO structure that receives error information void GetExceptionInfo( [Out] out EXCEPINFO exceptionInfo ); diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs index b89d570..39c5f0f 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse32.cs @@ -13,11 +13,11 @@ namespace MsieJavaScriptEngine.ActiveScript /// /// /// Before the scripting engine can be used, one of the following methods must be called: - /// IPersist.Load, IPersist.InitNew, or . The semantics of - /// this method are identical to IPersistStreamInit.InitNew, in that this method tells the scripting - /// engine to initialize itself. Note that it is not valid to call both IPersist.InitNew or - /// and IPersist.Load, nor is it valid to call - /// IPersist.InitNew, , or IPersist.Load more than once. + /// IPersist.Load, IPersist.InitNew, or . The semantics of + /// this method are identical to IPersistStreamInit.InitNew, in that this method tells the scripting + /// engine to initialize itself. Note that it is not valid to call both IPersist.InitNew or + /// and IPersist.Load, nor is it valid to call + /// IPersist.InitNew, , or IPersist.Load more than once. /// [ComImport] [Guid("bb1a2ae2-a4f9-11cf-8f20-00805f2cd064")] @@ -32,14 +32,14 @@ internal interface IActiveScriptParse32 /// /// Adds a code scriptlet to the script. This method is used in environments where the /// persistent state of the script is intertwined with the host document and the host - /// is responsible for restoring the script, rather than through an IPersist interface. + /// is responsible for restoring the script, rather than through an IPersist interface. /// The primary examples are HTML scripting languages that allow scriptlets of code /// embedded in the HTML document to be attached to intrinsic events (for instance, - /// ONCLICK="button1.text='Exit'"). + /// ONCLICK="button1.text='Exit'"). /// /// The default name to associate with the scriptlet. If the - /// scriptlet does not contain naming information (as in the ONCLICK example above), - /// this name will be used to identify the scriptlet. If this parameter is null, the + /// scriptlet does not contain naming information (as in the ONCLICK example above), + /// this name will be used to identify the scriptlet. If this parameter is null, the /// scripting engine manufactures a unique name, if necessary. /// The scriptlet text to add. The interpretation of this string /// depends on the scripting language. @@ -48,7 +48,7 @@ internal interface IActiveScriptParse32 /// scriptlet is an event handler. /// The name of a subobject of the named item with which this /// scriptlet is associated; this name must be found in the named item's type - /// information. This parameter is null if the scriptlet is to be associated with the + /// information. This parameter is null if the scriptlet is to be associated with the /// named item instead of a subitem. This parameter, in addition to /// , identifies the specific object for which the scriptlet /// is an event handler. @@ -61,7 +61,7 @@ internal interface IActiveScriptParse32 /// provide some conditional primitive preprocessing (for example, replacing a single /// quotation mark ['] with two single quotation marks for use as a delimiter). /// Exactly how (and if) the scripting engine makes use of this information depends - /// on the scripting engine. Set this parameter to null if the host did not use a + /// on the scripting engine. Set this parameter to null if the host did not use a /// delimiter to mark the end of the scriptlet. /// Application-defined value that is used for /// debugging purposes @@ -73,7 +73,7 @@ internal interface IActiveScriptParse32 /// default name provided in , or a unique name /// synthesized by the scripting engine. /// Exception information. This structure should be - /// filled in if DISP_E_EXCEPTION is returned + /// filled in if DISP_E_EXCEPTION is returned void AddScriptlet( [In] [MarshalAs(UnmanagedType.LPWStr)] string defaultName, [In] [MarshalAs(UnmanagedType.LPWStr)] string code, @@ -95,11 +95,11 @@ [Out] out EXCEPINFO exceptionInfo /// The scriptlet text to evaluate. The interpretation of this /// string depends on the scripting language /// The item name that gives the context in which the - /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated + /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated /// in the scripting engine's global context /// The context object. This object is reserved for use in a /// debugging environment, where such a context may be provided by the debugger to - /// represent an active run-time context. If this parameter is null, the engine + /// represent an active run-time context. If this parameter is null, the engine /// uses to identify the context. /// The end-of-scriptlet delimiter. When /// is parsed from a stream of text, the host typically uses a delimiter, such as two @@ -108,18 +108,18 @@ [Out] out EXCEPINFO exceptionInfo /// some conditional primitive preprocessing (for example, replacing a single quotation /// mark ['] with two single quotation marks for use as a delimiter). Exactly how /// (and if) the scripting engine makes use of this information depends on the - /// scripting engine. Set this parameter to null if the host did not use a delimiter + /// scripting engine. Set this parameter to null if the host did not use a delimiter /// to mark the end of the scriptlet. /// Application-defined value that is used for /// debugging purposes /// Zero-based value that specifies which line the /// parsing will begin at /// Flags associated with the scriptlet - /// The results of scriptlet processing, or null if the caller + /// The results of scriptlet processing, or null if the caller /// expects no result (that is, the value is /// not set) /// The exception information. This structure is filled if - /// returns DISP_E_EXCEPTION. + /// returns DISP_E_EXCEPTION. void ParseScriptText( [In] [MarshalAs(UnmanagedType.LPWStr)] string code, [In] [MarshalAs(UnmanagedType.LPWStr)] string itemName, diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs index d4342a1..bb98f86 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptParse64.cs @@ -13,11 +13,11 @@ namespace MsieJavaScriptEngine.ActiveScript /// /// /// Before the scripting engine can be used, one of the following methods must be called: - /// IPersist.Load, IPersist.InitNew, or . The semantics of - /// this method are identical to IPersistStreamInit.InitNew, in that this method tells the scripting - /// engine to initialize itself. Note that it is not valid to call both IPersist.InitNew or - /// and IPersist.Load, nor is it valid to call - /// IPersist.InitNew, , or IPersist.Load more than once. + /// IPersist.Load, IPersist.InitNew, or . The semantics of + /// this method are identical to IPersistStreamInit.InitNew, in that this method tells the scripting + /// engine to initialize itself. Note that it is not valid to call both IPersist.InitNew or + /// and IPersist.Load, nor is it valid to call + /// IPersist.InitNew, , or IPersist.Load more than once. /// [ComImport] [Guid("c7ef7658-e1ee-480e-97ea-d52cb4d76d17")] @@ -32,14 +32,14 @@ internal interface IActiveScriptParse64 /// /// Adds a code scriptlet to the script. This method is used in environments where the /// persistent state of the script is intertwined with the host document and the host - /// is responsible for restoring the script, rather than through an IPersist interface. + /// is responsible for restoring the script, rather than through an IPersist interface. /// The primary examples are HTML scripting languages that allow scriptlets of code /// embedded in the HTML document to be attached to intrinsic events (for instance, - /// ONCLICK="button1.text='Exit'"). + /// ONCLICK="button1.text='Exit'"). /// /// The default name to associate with the scriptlet. If the - /// scriptlet does not contain naming information (as in the ONCLICK example above), - /// this name will be used to identify the scriptlet. If this parameter is null, the + /// scriptlet does not contain naming information (as in the ONCLICK example above), + /// this name will be used to identify the scriptlet. If this parameter is null, the /// scripting engine manufactures a unique name, if necessary. /// The scriptlet text to add. The interpretation of this string /// depends on the scripting language. @@ -48,7 +48,7 @@ internal interface IActiveScriptParse64 /// scriptlet is an event handler. /// The name of a subobject of the named item with which this /// scriptlet is associated; this name must be found in the named item's type - /// information. This parameter is null if the scriptlet is to be associated with the + /// information. This parameter is null if the scriptlet is to be associated with the /// named item instead of a subitem. This parameter, in addition to /// , identifies the specific object for which the scriptlet /// is an event handler. @@ -61,7 +61,7 @@ internal interface IActiveScriptParse64 /// provide some conditional primitive preprocessing (for example, replacing a single /// quotation mark ['] with two single quotation marks for use as a delimiter). /// Exactly how (and if) the scripting engine makes use of this information depends - /// on the scripting engine. Set this parameter to null if the host did not use a + /// on the scripting engine. Set this parameter to null if the host did not use a /// delimiter to mark the end of the scriptlet. /// Application-defined value that is used for /// debugging purposes @@ -73,7 +73,7 @@ internal interface IActiveScriptParse64 /// default name provided in , or a unique name /// synthesized by the scripting engine. /// Exception information. This structure should be - /// filled in if DISP_E_EXCEPTION is returned + /// filled in if DISP_E_EXCEPTION is returned void AddScriptlet( [In] [MarshalAs(UnmanagedType.LPWStr)] string defaultName, [In] [MarshalAs(UnmanagedType.LPWStr)] string code, @@ -95,11 +95,11 @@ [Out] out EXCEPINFO exceptionInfo /// The scriptlet text to evaluate. The interpretation of this /// string depends on the scripting language /// The item name that gives the context in which the - /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated + /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated /// in the scripting engine's global context /// The context object. This object is reserved for use in a /// debugging environment, where such a context may be provided by the debugger to - /// represent an active run-time context. If this parameter is null, the engine + /// represent an active run-time context. If this parameter is null, the engine /// uses to identify the context. /// The end-of-scriptlet delimiter. When /// is parsed from a stream of text, the host typically uses a delimiter, such as two @@ -108,18 +108,18 @@ [Out] out EXCEPINFO exceptionInfo /// some conditional primitive preprocessing (for example, replacing a single quotation /// mark ['] with two single quotation marks for use as a delimiter). Exactly how /// (and if) the scripting engine makes use of this information depends on the - /// scripting engine. Set this parameter to null if the host did not use a delimiter + /// scripting engine. Set this parameter to null if the host did not use a delimiter /// to mark the end of the scriptlet. /// Application-defined value that is used for /// debugging purposes /// Zero-based value that specifies which line the /// parsing will begin at /// Flags associated with the scriptlet - /// The results of scriptlet processing, or null if the caller + /// The results of scriptlet processing, or null if the caller /// expects no result (that is, the value is /// not set) /// The exception information. This structure is filled if - /// returns DISP_E_EXCEPTION. + /// returns DISP_E_EXCEPTION. void ParseScriptText( [In] [MarshalAs(UnmanagedType.LPWStr)] string code, [In] [MarshalAs(UnmanagedType.LPWStr)] string itemName, diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs index 5c373ff..0cc4785 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptProperty.cs @@ -19,7 +19,7 @@ internal interface IActiveScriptProperty /// The property value to get /// Not used /// The value of the property - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint GetProperty( [In] uint dwProperty, @@ -33,7 +33,7 @@ [Out] out object pvarValue /// The property value to set /// Not used /// The value of the property - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint SetProperty( [In] uint dwProperty, diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs index 0bf8302..494dff0 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSite.cs @@ -41,23 +41,23 @@ [Out] out int lcid /// returned. The scripting engine should request the minimum amount of information possible /// because some of the return parameters (for example, ) can take /// considerable time to load or generate. - /// A variable that receives a pointer to the IUnknown interface - /// associated with the given item. The scripting engine can use the IUnknown.QueryInterface - /// method to obtain the IDispatch interface for the item. This parameter receives null if + /// A variable that receives a pointer to the IUnknown interface + /// associated with the given item. The scripting engine can use the IUnknown.QueryInterface + /// method to obtain the IDispatch interface for the item. This parameter receives null if /// mask does not include the value. Also, it receives - /// null if there is no object associated with the item name; this mechanism is used to create + /// null if there is no object associated with the item name; this mechanism is used to create /// a simple class when the named item was added with the /// flag set in the method. /// A variable that receives a pointer to the - /// interface associated with the item. This parameter receives null if mask does not include + /// interface associated with the item. This parameter receives null if mask does not include /// the value, or if type information is not available /// for this item. If type information is not available, the object cannot source events, and - /// name binding must be realized with the IDispatch.GetIDsOfNames method. Note that the - /// interface retrieved describes the item's coclass (TKIND_COCLASS) + /// name binding must be realized with the IDispatch.GetIDsOfNames method. Note that the + /// interface retrieved describes the item's coclass (TKIND_COCLASS) /// because the object may support multiple interfaces and event interfaces. If the item supports - /// the IProvideMultipleTypeInfo interface, the interface retrieved is + /// the IProvideMultipleTypeInfo interface, the interface retrieved is /// the same as the index zero that would be obtained using the - /// IProvideMultipleTypeInfo.GetInfoOfIndex method. + /// IProvideMultipleTypeInfo.GetInfoOfIndex method. void GetItemInfo( [In] [MarshalAs(UnmanagedType.LPWStr)] string name, [In] ScriptInfoFlags mask, @@ -79,10 +79,10 @@ [Out] [MarshalAs(UnmanagedType.BStr)] out string version /// /// Informs the host that the script has completed execution /// - /// A variable that contains the script result, or null if the script + /// A variable that contains the script result, or null if the script /// produced no result /// Contains exception information generated when the script - /// terminated, or null if no exception was generated + /// terminated, or null if no exception was generated void OnScriptTerminate( [In] object result, [In] EXCEPINFO exceptionInfo diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs index c8c7c96..42aeb21 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptSiteInterruptPoll.cs @@ -15,7 +15,7 @@ internal interface IActiveScriptSiteInterruptPoll /// /// Allows a host to specify that a script should terminate /// - /// The method returns an HRESULT + /// The method returns an HRESULT [PreserveSig] uint QueryContinue(); } diff --git a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs index afe457f..fb1bcd1 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/IActiveScriptWrapper.cs @@ -60,11 +60,11 @@ ScriptItemFlags flags /// The scriptlet text to evaluate. The interpretation of this /// string depends on the scripting language /// The item name that gives the context in which the - /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated + /// scriptlet is to be evaluated. If this parameter is null, the code is evaluated /// in the scripting engine's global context /// The context object. This object is reserved for use in a /// debugging environment, where such a context may be provided by the debugger to - /// represent an active run-time context. If this parameter is null, the engine + /// represent an active run-time context. If this parameter is null, the engine /// uses to identify the context. /// The end-of-scriptlet delimiter. When /// is parsed from a stream of text, the host typically uses a delimiter, such as two @@ -73,14 +73,14 @@ ScriptItemFlags flags /// some conditional primitive preprocessing (for example, replacing a single quotation /// mark ['] with two single quotation marks for use as a delimiter). Exactly how /// (and if) the scripting engine makes use of this information depends on the - /// scripting engine. Set this parameter to null if the host did not use a delimiter + /// scripting engine. Set this parameter to null if the host did not use a delimiter /// to mark the end of the scriptlet. /// Application-defined value that is used for /// debugging purposes /// Zero-based value that specifies which line the /// parsing will begin at /// Flags associated with the scriptlet - /// The results of scriptlet processing, or null if the caller expects no + /// The results of scriptlet processing, or null if the caller expects no /// result (that is, the value is not set) object ParseScriptText( string code, diff --git a/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs b/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs index ce14c46..fd135a0 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/JScriptRuntimeErrorNumber.cs @@ -23,7 +23,7 @@ internal static class JScriptRuntimeErrorNumber public const int OutOfStackSpace = 28; /// - /// Cannot assign to 'this' + /// Cannot assign to this /// public const int CannotAssignToThisKeyword = 5000; @@ -108,12 +108,12 @@ internal static class JScriptRuntimeErrorNumber public const int UnexpectedQuantifier = 5018; /// - /// Expected ']' in regular expression + /// Expected ] in regular expression /// public const int ExpectedRightSquareBracketInRegularExpression = 5019; /// - /// Expected ')' in regular expression + /// Expected ) in regular expression /// public const int ExpectedRightParenthesisInRegularExpression = 5020; diff --git a/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs b/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs index 40501e3..76544e7 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/JScriptSyntaxErrorNumber.cs @@ -23,37 +23,37 @@ internal static class JScriptSyntaxErrorNumber public const int SyntaxError = 1002; /// - /// Expected ':' + /// Expected : /// public const int ExpectedColon = 1003; /// - /// Expected ';' + /// Expected ; /// public const int ExpectedSemicolon = 1004; /// - /// Expected '(' + /// Expected ( /// public const int ExpectedLeftParenthesis = 1005; /// - /// Expected ')' + /// Expected ) /// public const int ExpectedRightParenthesis = 1006; /// - /// Expected ']' + /// Expected ] /// public const int ExpectedRightSquareBracket = 1007; /// - /// Expected '{' + /// Expected { /// public const int ExpectedLeftCurlyBrace = 1008; /// - /// Expected '}' + /// Expected } /// public const int ExpectedRightCurlyBrace = 1009; @@ -63,12 +63,12 @@ internal static class JScriptSyntaxErrorNumber public const int ExpectedIdentifier = 1010; /// - /// Expected '=' + /// Expected = /// public const int ExpectedEqualSign = 1011; /// - /// Expected '/' + /// Expected / /// public const int ExpectedForwardSlash = 1012; @@ -88,17 +88,17 @@ internal static class JScriptSyntaxErrorNumber public const int UnterminatedComment = 1016; /// - /// 'return' statement outside of function + /// return statement outside of function /// public const int ReturnStatementOutsideOfFunction = 1018; /// - /// Can't have 'break' outside of loop + /// Can't have break outside of loop /// public const int CannotHaveBreakStatementOutsideOfLoop = 1019; /// - /// Can't have 'continue' outside of loop + /// Can't have continue outside of loop /// public const int CannotHaveContinueStatementOutsideOfLoop = 1020; @@ -108,7 +108,7 @@ internal static class JScriptSyntaxErrorNumber public const int ExpectedHexadecimalDigit = 1023; /// - /// Expected 'while' + /// Expected while /// public const int ExpectedWhileStatement = 1024; @@ -123,7 +123,7 @@ internal static class JScriptSyntaxErrorNumber public const int LabelNotFound = 1026; /// - /// 'default' can only appear once in a 'switch' statement + /// default can only appear once in a switch statement /// public const int DefaultStatementCanOnlyAppearOnceInSwitchStatement = 1027; @@ -133,7 +133,7 @@ internal static class JScriptSyntaxErrorNumber public const int ExpectedIdentifierStringOrNumber = 1028; /// - /// Expected '@end' + /// Expected @end /// public const int ExpectedConditionalCompilationEndStatement = 1029; @@ -148,12 +148,12 @@ internal static class JScriptSyntaxErrorNumber public const int ExpectedConstant = 1031; /// - /// Expected '@' + /// Expected @ /// public const int ExpectedAtSign = 1032; /// - /// Expected 'catch' + /// Expected catch /// public const int ExpectedCatchStatement = 1033; diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs index 97d07e8..26088b3 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptInfoFlags.cs @@ -12,12 +12,12 @@ internal enum ScriptInfoFlags : uint None = 0, /// - /// Returns the IUnknown interface for this item + /// Returns the IUnknown interface for this item /// IUnknown = 1, /// - /// Returns the ITypeInfo interface for this item + /// Returns the ITypeInfo interface for this item /// ITypeInfo = 2 } diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs index 5b9958a..b627cae 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptItemFlags.cs @@ -30,11 +30,11 @@ internal enum ScriptItemFlags : uint /// /// Indicates that the item is a collection of global properties and methods associated /// with the script. Normally, a scripting engine would ignore the object name (other than - /// for the purpose of using it as a cookie for the IActiveScriptSite.GetItemInfo method, + /// for the purpose of using it as a cookie for the method, /// or for resolving explicit scoping) and expose its members as global variables and /// methods. This allows the host to extend the library (run-time functions and so on) /// available to the script. It is left to the scripting engine to deal with name conflicts - /// (for example, when two ScriptItemFlags.GlobalMembers items have methods of the same + /// (for example, when two items have methods of the same /// name), although an error should not be returned because of this situation. /// GlobalMembers = 0x00000008, @@ -49,7 +49,7 @@ internal enum ScriptItemFlags : uint /// /// Indicates that the named item represents a code-only object, and that the host has no - /// IUnknown to be associated with this code-only object. The host only has a name for this + /// IUnknown to be associated with this code-only object. The host only has a name for this /// object. In object-oriented languages such as C++, this flag would create a class. /// Not all languages support this flag. /// diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs index 0bab796..6d83292 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptProperty.cs @@ -8,7 +8,7 @@ internal enum ScriptProperty : uint { /// /// Forces the scripting engine to divide in integer mode instead of floating point mode. - /// The default value is False. + /// The default value is false. /// IntegerMode = 0x00003000, diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs index da2b0ba..a8b8a92 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptState.cs @@ -7,21 +7,21 @@ namespace MsieJavaScriptEngine.ActiveScript internal enum ScriptState : uint { /// - /// Script has just been created, but has not yet been initialized using an IPersist* - /// interface and IActiveScript.SetScriptSite + /// Script has just been created, but has not yet been initialized using an IPersist* + /// interface and /// Uninitialized = 0, /// /// Script has been initialized, but is not running (connecting to other objects or /// sinking events) or executing any code. Code can be queried for execution by - /// calling the IActiveScriptParse.ParseScriptText method. + /// calling the IActiveScriptParse.ParseScriptText method. /// Initialized = 1, /// /// Script can execute code, but is not yet sinking the events of objects added by - /// the IActiveScript.AddNamedItem method + /// the IActiveScript.AddNamedItem method /// Started = 2, diff --git a/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs b/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs index 3b43870..d8c9ba9 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ScriptTextFlags.cs @@ -25,7 +25,7 @@ internal enum ScriptTextFlags : uint /// /// Indicates that the code added during this call should be saved if the scripting engine is saved - /// (for example, through a call to IPersist*::Save), or if the scripting engine is reset by way of + /// (for example, through a call to IPersist*.Save), or if the scripting engine is reset by way of /// a transition back to the initialized state. For more information about this state, see Script /// Engine States /// diff --git a/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs b/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs index e1b71ba..f6f42b1 100644 --- a/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs +++ b/src/MsieJavaScriptEngine/Extensions/StringExtensions.cs @@ -12,7 +12,7 @@ internal static class StringExtensions /// /// Instance of /// The string without quotes to seek - /// true if the quoted value occurs within this string; otherwise, false + /// true if the quoted value occurs within this string; otherwise, false public static bool ContainsQuotedValue(this string source, string value) { if (source == null) @@ -128,7 +128,7 @@ public static string[] SplitToLines(this string source) /// When this method returns, contains the character from the string, /// if the receiving succeeded, or null character if the receiving failed. /// The receiving fails if the index out of bounds. - /// true if the character was received successfully; otherwise, false + /// true if the character was received successfully; otherwise, false public static bool TryGetChar(this string source, int index, out char result) { if (source == null) diff --git a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs index 62536d5..0f37cf5 100644 --- a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs @@ -258,7 +258,7 @@ public Type[] ParameterTypes set; } - /// TODO: In future will need to change type to double + /// TODO: In future will need to change type to double public ushort CompatibilityScore { get; diff --git a/src/MsieJavaScriptEngine/Helpers/ValidationHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ValidationHelpers.cs index b1f7511..7098a15 100644 --- a/src/MsieJavaScriptEngine/Helpers/ValidationHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ValidationHelpers.cs @@ -34,7 +34,7 @@ public static class ValidationHelpers /// Checks whether supports a .NET type /// /// .NET type - /// Result of check (true - is supported; false - is not supported) + /// Result of check (true - is supported; false - is not supported) public static bool IsSupportedType(Type type) { bool result = _supportedTypes.Contains(type); @@ -46,7 +46,7 @@ public static bool IsSupportedType(Type type) /// Checks whether .NET type is primitive /// /// .NET type - /// Result of check (true - is primitive; false - is not primitive) + /// Result of check (true - is primitive; false - is not primitive) public static bool IsPrimitiveType(Type type) { return TypeConverter.IsPrimitiveType(type); @@ -56,7 +56,7 @@ public static bool IsPrimitiveType(Type type) /// Checks a format of the name /// /// The name - /// Result of check (true - correct format; false - wrong format) + /// Result of check (true - correct format; false - wrong format) public static bool CheckNameFormat(string name) { return _jsNameRegex.IsMatch(name); @@ -66,7 +66,7 @@ public static bool CheckNameFormat(string name) /// Checks a format of the document name /// /// The document name - /// Result of check (true - correct format; false - wrong format) + /// Result of check (true - correct format; false - wrong format) public static bool CheckDocumentNameFormat(string name) { return _documentNameRegex.IsMatch(name); diff --git a/src/MsieJavaScriptEngine/IInnerJsEngine.cs b/src/MsieJavaScriptEngine/IInnerJsEngine.cs index 0d5ed42..040dcb8 100644 --- a/src/MsieJavaScriptEngine/IInnerJsEngine.cs +++ b/src/MsieJavaScriptEngine/IInnerJsEngine.cs @@ -60,7 +60,7 @@ internal interface IInnerJsEngine : IDisposable /// Сhecks for the existence of a variable /// /// Name of variable - /// Result of check (true - exists; false - not exists + /// Result of check (true - exists; false - not exists bool HasVariable(string variableName); /// diff --git a/src/MsieJavaScriptEngine/JsEngineSettings.cs b/src/MsieJavaScriptEngine/JsEngineSettings.cs index e6311b8..f4b2094 100644 --- a/src/MsieJavaScriptEngine/JsEngineSettings.cs +++ b/src/MsieJavaScriptEngine/JsEngineSettings.cs @@ -50,7 +50,7 @@ public JsEngineMode EngineMode /// Gets or sets a maximum stack size in bytes /// /// - /// Set a 0 to use the default maximum stack size specified in the header + /// Set a 0 to use the default maximum stack size specified in the header /// for the executable. /// /// diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs b/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs index 2216747..d7271ac 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs @@ -121,7 +121,7 @@ private static EdgeJsRuntime CreateJsRuntime() /// /// Checks a support of the Chakra “Edge” JsRT engine /// - /// Result of check (true - supports; false - does not support) + /// Result of check (true - supports; false - does not support) public static bool IsSupported() { if (_isSupported.HasValue) @@ -191,7 +191,7 @@ private static void RemoveReferenceToValue(EdgeJsValue value) /// Checks whether the value can have references /// /// The value - /// Result of check (true - may have; false - may not have) + /// Result of check (true - may have; false - may not have) private static bool CanHaveReferences(EdgeJsValue value) { JsValueType valueType = value.ValueType; @@ -772,8 +772,7 @@ public override void Dispose() /// /// Destroys object /// - /// Flag, allowing destruction of - /// managed objects contained in fields of class + /// Flag, allowing destruction of managed objects contained in fields of class private void Dispose(bool disposing) { if (disposing) diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs index fc91404..ffde72d 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs @@ -314,7 +314,7 @@ public static void StartDebugging() /// Adds a reference to a script context /// /// - /// Calling AddRef ensures that the context will not be freed until Release is called. + /// Calling AddRef ensures that the context will not be freed until Release is called. /// /// The object's new reference count public uint AddRef() @@ -329,7 +329,7 @@ public uint AddRef() /// Releases a reference to a script context /// /// - /// Removes a reference to a context that was created by AddRef. + /// Removes a reference to a context that was created by AddRef. /// /// The object's new reference count public uint Release() diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsErrorHelpers.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsErrorHelpers.cs index 9eefe16..755eaaa 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsErrorHelpers.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsErrorHelpers.cs @@ -122,7 +122,7 @@ public static void ThrowIfError(JsErrorCode errorCode) /// - /// Creates a new JavaScript error object + /// Creates a new JavaScript Error object /// /// /// Requires an active script context. @@ -138,7 +138,7 @@ public static EdgeJsValue CreateError(string message) } /// - /// Creates a new JavaScript RangeError error object + /// Creates a new JavaScript RangeError error object /// /// /// Requires an active script context. @@ -154,7 +154,7 @@ public static EdgeJsValue CreateRangeError(string message) } /// - /// Creates a new JavaScript ReferenceError error object + /// Creates a new JavaScript ReferenceError error object /// /// /// Requires an active script context. @@ -170,7 +170,7 @@ public static EdgeJsValue CreateReferenceError(string message) } /// - /// Creates a new JavaScript SyntaxError error object + /// Creates a new JavaScript SyntaxError error object /// /// /// Requires an active script context. @@ -186,7 +186,7 @@ public static EdgeJsValue CreateSyntaxError(string message) } /// - /// Creates a new JavaScript TypeError error object + /// Creates a new JavaScript TypeError error object /// /// /// Requires an active script context. @@ -202,7 +202,7 @@ public static EdgeJsValue CreateTypeError(string message) } /// - /// Creates a new JavaScript URIError error object + /// Creates a new JavaScript URIError error object /// /// /// Requires an active script context. diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsNativeFunction.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsNativeFunction.cs index f3ca6a0..30f79a2 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsNativeFunction.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsNativeFunction.cs @@ -7,7 +7,7 @@ namespace MsieJavaScriptEngine.JsRt.Edge /// “Edge” function callback /// /// The Function object that represents the function being invoked - /// Indicates whether this is a regular call or a 'new' call + /// Indicates whether this is a regular call or a new call /// The arguments to the call /// The number of arguments /// Callback data, if any diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs index 38ff239..89d449e 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs @@ -17,7 +17,7 @@ namespace MsieJavaScriptEngine.JsRt.Edge /// /// NOTE: A , unlike other objects in the Chakra hosting API, is not /// garbage collected since it contains the garbage collected heap itself. A runtime will - /// continue to exist until Dispose is called. + /// continue to exist until Dispose is called. /// /// internal struct EdgeJsRuntime : IDisposable @@ -121,7 +121,7 @@ public static EdgeJsRuntime Create(JsRuntimeAttributes attributes) /// Creates a new runtime /// /// The attributes of the runtime to be created - /// The thread service for the runtime. Can be null + /// The thread service for the runtime. Can be null /// The runtime created public static EdgeJsRuntime Create(JsRuntimeAttributes attributes, JsThreadServiceCallback threadServiceCallback) { @@ -147,7 +147,7 @@ public void CollectGarbage() /// Registering a memory allocation callback will cause the runtime to call back to the host /// whenever it acquires memory from, or releases memory to, the OS. The callback routine is /// called before the runtime memory manager allocates a block of memory. The allocation will - /// be rejected if the callback returns false. The runtime memory manager will also invoke the + /// be rejected if the callback returns false. The runtime memory manager will also invoke the /// callback routine after freeing a block of memory, as well as after allocation failures. /// /// diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs index 67e8c34..140fa09 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsValue.cs @@ -7,8 +7,8 @@ namespace MsieJavaScriptEngine.JsRt.Edge /// “Edge” JavaScript value /// /// - /// The JavaScript value is one of the following types of values: Undefined, Null, Boolean, - /// String, Number, or Object. + /// The JavaScript value is one of the following types of values: undefined, null, Boolean, + /// String, Number, or Object. /// internal struct EdgeJsValue { @@ -326,8 +326,8 @@ public static EdgeJsValue CreateObject() /// /// Requires an active script context. /// - /// External data that the object will represent. May be null - /// The callback for when the object is finalized. May be null. + /// External data that the object will represent. May be null + /// The callback for when the object is finalized. May be null. /// The new Object public static EdgeJsValue CreateExternalObject(IntPtr data, JsFinalizeCallback finalizer) { @@ -387,7 +387,7 @@ public static EdgeJsValue CreateArray(uint length) } /// - /// Creates a new JavaScript error object + /// Creates a new JavaScript Error object /// /// /// Requires an active script context. @@ -403,7 +403,7 @@ public static EdgeJsValue CreateError(EdgeJsValue message) } /// - /// Creates a new JavaScript RangeError error object + /// Creates a new JavaScript RangeError error object /// /// /// Requires an active script context. @@ -419,7 +419,7 @@ public static EdgeJsValue CreateRangeError(EdgeJsValue message) } /// - /// Creates a new JavaScript ReferenceError error object + /// Creates a new JavaScript ReferenceError error object /// /// /// Requires an active script context. @@ -435,7 +435,7 @@ public static EdgeJsValue CreateReferenceError(EdgeJsValue message) } /// - /// Creates a new JavaScript SyntaxError error object + /// Creates a new JavaScript SyntaxError error object /// /// /// Requires an active script context. @@ -451,7 +451,7 @@ public static EdgeJsValue CreateSyntaxError(EdgeJsValue message) } /// - /// Creates a new JavaScript TypeError error object + /// Creates a new JavaScript TypeError error object /// /// /// Requires an active script context. @@ -467,7 +467,7 @@ public static EdgeJsValue CreateTypeError(EdgeJsValue message) } /// - /// Creates a new JavaScript URIError error object + /// Creates a new JavaScript URIError error object /// /// /// Requires an active script context. @@ -487,8 +487,8 @@ public static EdgeJsValue CreateUriError(EdgeJsValue message) /// /// /// This only needs to be called on objects that are not going to be stored somewhere on - /// the stack. Calling AddRef ensures that the JavaScript object the value refers to will not be freed - /// until Release is called. + /// the stack. Calling AddRef ensures that the JavaScript object the value refers to will not be freed + /// until Release is called. /// /// The object's new reference count public uint AddRef() @@ -503,7 +503,7 @@ public uint AddRef() /// Releases a reference to the object /// /// - /// Removes a reference that was created by AddRef. + /// Removes a reference that was created by AddRef. /// /// The object's new reference count public uint Release() @@ -534,7 +534,7 @@ public bool ToBoolean() /// /// /// - /// This function retrieves the value of a Number value. It will fail with + /// This function retrieves the value of a Number value. It will fail with /// InvalidArgument if the type of the value is not Number. /// /// @@ -838,7 +838,7 @@ public void DeleteIndexedProperty(EdgeJsValue index) /// /// /// - /// This function is equivalent to the "==" operator in JavaScript. + /// This function is equivalent to the == operator in JavaScript. /// /// /// Requires an active script context. @@ -859,7 +859,7 @@ public bool Equals(EdgeJsValue other) /// /// /// - /// This function is equivalent to the "===" operator in JavaScript. + /// This function is equivalent to the === operator in JavaScript. /// /// /// Requires an active script context. @@ -882,7 +882,7 @@ public bool StrictEquals(EdgeJsValue other) /// Requires an active script context. /// /// The arguments to the call - /// The Value returned from the function invocation, if any + /// The JavaScript value returned from the function invocation, if any public EdgeJsValue CallFunction(params EdgeJsValue[] arguments) { EdgeJsValue returnReference; @@ -904,7 +904,7 @@ public EdgeJsValue CallFunction(params EdgeJsValue[] arguments) /// Requires an active script context. /// /// The arguments to the call - /// The Value returned from the function invocation + /// The JavaScript value returned from the function invocation public EdgeJsValue ConstructObject(params EdgeJsValue[] arguments) { EdgeJsValue returnReference; diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs b/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs index 759544d..11fddd7 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs @@ -137,7 +137,7 @@ private static IeJsRuntime CreateJsRuntime() /// /// Checks a support of the Chakra “IE” JsRT engine /// - /// Result of check (true - supports; false - does not support) + /// Result of check (true - supports; false - does not support) public static bool IsSupported() { if (_isSupported.HasValue) @@ -224,7 +224,7 @@ private static void RemoveReferenceToValue(IeJsValue value) /// Checks whether the value can have references /// /// The value - /// Result of check (true - may have; false - may not have) + /// Result of check (true - may have; false - may not have) private static bool CanHaveReferences(IeJsValue value) { JsValueType valueType = value.ValueType; @@ -826,8 +826,7 @@ public override void Dispose() /// /// Destroys object /// - /// Flag, allowing destruction of - /// managed objects contained in fields of class + /// Flag, allowing destruction of managed objects contained in fields of class private void Dispose(bool disposing) { if (disposing) diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs index 0aed8ff..9c869bf 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs @@ -360,7 +360,7 @@ public static void StartDebugging() /// Adds a reference to a script context /// /// - /// Calling AddRef ensures that the context will not be freed until Release is called. + /// Calling AddRef ensures that the context will not be freed until Release is called. /// /// The object's new reference count public uint AddRef() @@ -375,7 +375,7 @@ public uint AddRef() /// Releases a reference to a script context /// /// - /// Removes a reference to a context that was created by AddRef. + /// Removes a reference to a context that was created by AddRef. /// /// The object's new reference count public uint Release() diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsErrorHelpers.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsErrorHelpers.cs index 4432941..b0346cd 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsErrorHelpers.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsErrorHelpers.cs @@ -122,7 +122,7 @@ public static void ThrowIfError(JsErrorCode errorCode) /// - /// Creates a new JavaScript error object + /// Creates a new JavaScript Error object /// /// /// Requires an active script context. @@ -138,7 +138,7 @@ public static IeJsValue CreateError(string message) } /// - /// Creates a new JavaScript RangeError error object + /// Creates a new JavaScript RangeError error object /// /// /// Requires an active script context. @@ -154,7 +154,7 @@ public static IeJsValue CreateRangeError(string message) } /// - /// Creates a new JavaScript ReferenceError error object + /// Creates a new JavaScript ReferenceError error object /// /// /// Requires an active script context. @@ -170,7 +170,7 @@ public static IeJsValue CreateReferenceError(string message) } /// - /// Creates a new JavaScript SyntaxError error object + /// Creates a new JavaScript SyntaxError error object /// /// /// Requires an active script context. @@ -186,7 +186,7 @@ public static IeJsValue CreateSyntaxError(string message) } /// - /// Creates a new JavaScript TypeError error object + /// Creates a new JavaScript TypeError error object /// /// /// Requires an active script context. @@ -202,7 +202,7 @@ public static IeJsValue CreateTypeError(string message) } /// - /// Creates a new JavaScript URIError error object + /// Creates a new JavaScript URIError error object /// /// /// Requires an active script context. diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsNativeFunction.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsNativeFunction.cs index 517db1d..e7bb0a4 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsNativeFunction.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsNativeFunction.cs @@ -7,7 +7,7 @@ namespace MsieJavaScriptEngine.JsRt.Ie /// “IE” function callback /// /// The Function object that represents the function being invoked - /// Indicates whether this is a regular call or a 'new' call + /// Indicates whether this is a regular call or a new call /// The arguments to the call /// The number of arguments /// Callback data, if any diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs index bd5c95c..6f183ca 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs @@ -20,7 +20,7 @@ namespace MsieJavaScriptEngine.JsRt.Ie /// /// NOTE: A , unlike other objects in the Chakra hosting API, is not /// garbage collected since it contains the garbage collected heap itself. A runtime will - /// continue to exist until Dispose is called. + /// continue to exist until Dispose is called. /// /// internal struct IeJsRuntime : IDisposable @@ -126,7 +126,7 @@ public static IeJsRuntime Create(JsRuntimeAttributes attributes, JsRuntimeVersio /// /// The attributes of the runtime to be created /// The version of the runtime to be created - /// The thread service for the runtime. Can be null. + /// The thread service for the runtime. Can be null. /// The runtime created public static IeJsRuntime Create(JsRuntimeAttributes attributes, JsRuntimeVersion version, JsThreadServiceCallback threadServiceCallback) { @@ -152,7 +152,7 @@ public void CollectGarbage() /// Registering a memory allocation callback will cause the runtime to call back to the host /// whenever it acquires memory from, or releases memory to, the OS. The callback routine is /// called before the runtime memory manager allocates a block of memory. The allocation will - /// be rejected if the callback returns false. The runtime memory manager will also invoke the + /// be rejected if the callback returns false. The runtime memory manager will also invoke the /// callback routine after freeing a block of memory, as well as after allocation failures. /// /// diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs index b07fe42..bb6caa1 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsValue.cs @@ -8,8 +8,8 @@ namespace MsieJavaScriptEngine.JsRt.Ie /// “IE” JavaScript value /// /// - /// The JavaScript value is one of the following types of values: Undefined, Null, Boolean, - /// String, Number, or Object. + /// The JavaScript value is one of the following types of values: undefined, null, Boolean, + /// String, Number, or Object. /// internal struct IeJsValue { @@ -327,8 +327,8 @@ public static IeJsValue CreateObject() /// /// Requires an active script context. /// - /// External data that the object will represent. May be null. - /// A callback for when the object is finalized. May be null. + /// External data that the object will represent. May be null. + /// A callback for when the object is finalized. May be null. /// The new Object public static IeJsValue CreateExternalObject(IntPtr data, JsFinalizeCallback finalizer) { @@ -388,7 +388,7 @@ public static IeJsValue CreateArray(uint length) } /// - /// Creates a new JavaScript error object + /// Creates a new JavaScript Error object /// /// /// Requires an active script context. @@ -404,7 +404,7 @@ public static IeJsValue CreateError(IeJsValue message) } /// - /// Creates a new JavaScript RangeError error object + /// Creates a new JavaScript RangeError error object /// /// /// Requires an active script context. @@ -420,7 +420,7 @@ public static IeJsValue CreateRangeError(IeJsValue message) } /// - /// Creates a new JavaScript ReferenceError error object + /// Creates a new JavaScript ReferenceError error object /// /// /// Requires an active script context. @@ -436,7 +436,7 @@ public static IeJsValue CreateReferenceError(IeJsValue message) } /// - /// Creates a new JavaScript SyntaxError error object + /// Creates a new JavaScript SyntaxError error object /// /// /// Requires an active script context. @@ -452,7 +452,7 @@ public static IeJsValue CreateSyntaxError(IeJsValue message) } /// - /// Creates a new JavaScript TypeError error object + /// Creates a new JavaScript TypeError error object /// /// /// Requires an active script context. @@ -468,7 +468,7 @@ public static IeJsValue CreateTypeError(IeJsValue message) } /// - /// Creates a new JavaScript URIError error object + /// Creates a new JavaScript URIError error object /// /// /// Requires an active script context. @@ -488,8 +488,8 @@ public static IeJsValue CreateUriError(IeJsValue message) /// /// /// This only needs to be called on objects that are not going to be stored somewhere on - /// the stack. Calling AddRef ensures that the JavaScript object the value refers to will not be freed - /// until Release is called + /// the stack. Calling AddRef ensures that the JavaScript object the value refers to will not be freed + /// until Release is called /// /// The object's new reference count public uint AddRef() @@ -504,7 +504,7 @@ public uint AddRef() /// Releases a reference to the object /// /// - /// Removes a reference that was created by AddRef. + /// Removes a reference that was created by AddRef. /// /// The object's new reference count public uint Release() @@ -838,7 +838,7 @@ public void DeleteIndexedProperty(IeJsValue index) /// /// /// - /// This function is equivalent to the "==" operator in JavaScript. + /// This function is equivalent to the == operator in JavaScript. /// /// /// Requires an active script context. @@ -859,7 +859,7 @@ public bool Equals(IeJsValue other) /// /// /// - /// This function is equivalent to the "===" operator in JavaScript. + /// This function is equivalent to the === operator in JavaScript. /// /// /// Requires an active script context. @@ -882,7 +882,7 @@ public bool StrictEquals(IeJsValue other) /// Requires an active script context. /// /// The arguments to the call - /// The Value returned from the function invocation, if any + /// The JavaScript value returned from the function invocation, if any public IeJsValue CallFunction(params IeJsValue[] arguments) { IeJsValue returnReference; @@ -904,7 +904,7 @@ public IeJsValue CallFunction(params IeJsValue[] arguments) /// Requires an active script context. /// /// The arguments to the call - /// The Value returned from the function invocation + /// The JavaScript value returned from the function invocation public IeJsValue ConstructObject(params IeJsValue[] arguments) { IeJsValue returnReference; diff --git a/src/MsieJavaScriptEngine/JsRt/JsBeforeCollectCallback.cs b/src/MsieJavaScriptEngine/JsRt/JsBeforeCollectCallback.cs index dfcc3ab..a193022 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsBeforeCollectCallback.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsBeforeCollectCallback.cs @@ -5,6 +5,6 @@ namespace MsieJavaScriptEngine.JsRt /// /// The callback called before collection /// - /// The state passed to SetBeforeCollectCallback + /// The state passed to SetBeforeCollectCallback internal delegate void JsBeforeCollectCallback(IntPtr callbackState); } \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs b/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs index c747fed..aa56c5c 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs @@ -25,7 +25,7 @@ public enum JsErrorCode : uint InvalidArgument, /// - /// An argument to a hosting API was null in a context where null is not allowed + /// An argument to a hosting API was null in a context where null is not allowed /// NullArgument, @@ -77,7 +77,7 @@ public enum JsErrorCode : uint HeapEnumInProgress, /// - /// A hosting API that operates on Object values was called with a non-Object value + /// A hosting API that operates on Object values was called with a non-Object value /// ArgumentNotObject, diff --git a/src/MsieJavaScriptEngine/JsRt/JsMemoryAllocationCallback.cs b/src/MsieJavaScriptEngine/JsRt/JsMemoryAllocationCallback.cs index 4fa09cd..3e42539 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsMemoryAllocationCallback.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsMemoryAllocationCallback.cs @@ -5,12 +5,12 @@ namespace MsieJavaScriptEngine.JsRt /// /// User implemented callback routine for memory allocation events /// - /// The state passed to SetRuntimeMemoryAllocationCallback + /// The state passed to SetRuntimeMemoryAllocationCallback /// The type of type allocation event /// The size of the allocation /// - /// For the Allocate event, returning true allows the runtime to continue with - /// allocation. Returning false indicates the allocation request is rejected. The return value + /// For the Allocate event, returning true allows the runtime to continue with + /// allocation. Returning false indicates the allocation request is rejected. The return value /// is ignored for other allocation events. /// internal delegate bool JsMemoryAllocationCallback(IntPtr callbackState, JsMemoryEventType allocationEvent, UIntPtr allocationSize); diff --git a/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs b/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs index de0b008..cd0fdfd 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs @@ -38,7 +38,7 @@ internal enum JsRuntimeAttributes DisableNativeCodeGeneration = 0x00000008, /// - /// Using Eval or Function constructor will throw an exception + /// Using eval or Function constructor will throw an exception /// [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Eval is a valid function name.")] DisableEval = 0x00000010 diff --git a/src/MsieJavaScriptEngine/JsRt/JsThreadServiceCallback.cs b/src/MsieJavaScriptEngine/JsRt/JsThreadServiceCallback.cs index 6f9df33..5ab1e0d 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsThreadServiceCallback.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsThreadServiceCallback.cs @@ -9,7 +9,7 @@ namespace MsieJavaScriptEngine.JsRt /// The host can specify a background thread service when creating a runtime. If /// specified, then background work items will be passed to the host using this callback. The /// host is expected to either begin executing the background work item immediately and return - /// true or return false and the runtime will handle the work item in-thread. + /// true or return false and the runtime will handle the work item in-thread. /// /// The callback for the background work item /// The data argument to be passed to the callback diff --git a/src/MsieJavaScriptEngine/JsRt/JsValueType.cs b/src/MsieJavaScriptEngine/JsRt/JsValueType.cs index b50cfa7..e51dcff 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsValueType.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsValueType.cs @@ -16,37 +16,37 @@ internal enum JsValueType Null = 1, /// - /// The value is a JavaScript number value + /// The value is a JavaScript Number value /// Number = 2, /// - /// The value is a JavaScript string value + /// The value is a JavaScript String value /// String = 3, /// - /// The value is a JavaScript Boolean value + /// The value is a JavaScript Boolean value /// Boolean = 4, /// - /// The value is a JavaScript object value + /// The value is a JavaScript Object value /// Object = 5, /// - /// The value is a JavaScript function object value + /// The value is a JavaScript Function object value /// Function = 6, /// - /// The value is a JavaScript error object value + /// The value is a JavaScript Error object value /// Error = 7, /// - /// The value is a JavaScript array object value + /// The value is a JavaScript Array object value /// Array = 8 } diff --git a/src/MsieJavaScriptEngine/MsieJsEngine.cs b/src/MsieJavaScriptEngine/MsieJsEngine.cs index 206b5b1..93f21b9 100644 --- a/src/MsieJavaScriptEngine/MsieJsEngine.cs +++ b/src/MsieJavaScriptEngine/MsieJsEngine.cs @@ -1047,7 +1047,7 @@ public T CallFunction(string functionName, params object[] args) /// Сhecks for the existence of a variable /// /// Name of variable - /// Result of check (true - exists; false - not exists + /// Result of check (true - exists; false - not exists /// /// /// diff --git a/src/MsieJavaScriptEngine/ScriptDispatcher.cs b/src/MsieJavaScriptEngine/ScriptDispatcher.cs index ad5041e..4cdbdf2 100644 --- a/src/MsieJavaScriptEngine/ScriptDispatcher.cs +++ b/src/MsieJavaScriptEngine/ScriptDispatcher.cs @@ -56,7 +56,7 @@ public ScriptDispatcher() /// Constructs an instance of script dispatcher /// /// The maximum stack size, in bytes, to be used by the thread, - /// or 0 to use the default maximum stack size specified in the header for the executable. + /// or 0 to use the default maximum stack size specified in the header for the executable. public ScriptDispatcher(int maxStackSize) { _thread = new Thread(StartThread, maxStackSize) @@ -257,7 +257,7 @@ private abstract class ScriptTask : IDisposable /// /// Gets a exception, that occurred during the invocation of delegate. - /// If no exception has occurred, this will be null. + /// If no exception has occurred, this will be null. /// public Exception Exception { diff --git a/src/MsieJavaScriptEngine/Undefined.cs b/src/MsieJavaScriptEngine/Undefined.cs index f44eea9..a7097fc 100644 --- a/src/MsieJavaScriptEngine/Undefined.cs +++ b/src/MsieJavaScriptEngine/Undefined.cs @@ -1,12 +1,12 @@ namespace MsieJavaScriptEngine { /// - /// Represents an JS undefined type + /// Represents an JS undefined type /// public sealed class Undefined { /// - /// Gets a one and only undefined instance + /// Gets a one and only undefined instance /// public static readonly Undefined Value = new Undefined(); diff --git a/src/MsieJavaScriptEngine/Utilities/TypeConverter.cs b/src/MsieJavaScriptEngine/Utilities/TypeConverter.cs index e40c5ec..38bdc4a 100644 --- a/src/MsieJavaScriptEngine/Utilities/TypeConverter.cs +++ b/src/MsieJavaScriptEngine/Utilities/TypeConverter.cs @@ -64,7 +64,7 @@ public static object ConvertToType(object value, Type targetType) /// The type to convert the value to /// The value to convert /// The value that has been converted to the target type - /// Result of conversion (true - success; false - failure) + /// Result of conversion (true - success; false - failure) public static bool TryConvertToType(object value, out T convertedValue) { object resultValue; @@ -82,7 +82,7 @@ public static bool TryConvertToType(object value, out T convertedValue) /// The value to convert /// The type to convert the value to /// The value that has been converted to the target type - /// Result of conversion (true - success; false - failure) + /// Result of conversion (true - success; false - failure) public static bool TryConvertToType(object value, Type targetType, out object convertedValue) { bool result = ConvertObjectToType(value, targetType, false, out convertedValue); @@ -94,7 +94,7 @@ public static bool TryConvertToType(object value, Type targetType, out object co /// Checks whether .NET type is primitive /// /// .NET type - /// Result of check (true - is primitive; false - is not primitive) + /// Result of check (true - is primitive; false - is not primitive) internal static bool IsPrimitiveType(Type type) { TypeCode typeCode = type.GetTypeCode(); @@ -107,7 +107,7 @@ internal static bool IsPrimitiveType(Type type) /// Checks whether .NET type is primitive /// /// .NET type code - /// Result of check (true - is primitive; false - is not primitive) + /// Result of check (true - is primitive; false - is not primitive) internal static bool IsPrimitiveType(TypeCode typeCode) { bool result = _primitiveTypeCodes.Contains(typeCode); diff --git a/src/MsieJavaScriptEngine/Utilities/Utils.cs b/src/MsieJavaScriptEngine/Utilities/Utils.cs index 96ff86e..7acb73a 100644 --- a/src/MsieJavaScriptEngine/Utilities/Utils.cs +++ b/src/MsieJavaScriptEngine/Utilities/Utils.cs @@ -13,7 +13,7 @@ internal static class Utils /// /// Determines whether the current process is a 64-bit process /// - /// true if the process is 64-bit; otherwise, false + /// true if the process is 64-bit; otherwise, false [MethodImpl((MethodImplOptions)256 /* AggressiveInlining */)] public static bool Is64BitProcess() { From 013fe2566f530f2bf9cd0d8dca1bdc9dd277859f Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 6 Feb 2023 18:17:25 +0300 Subject: [PATCH 09/28] JSON2 library was updated to version of October 30, 2022 --- .../MsieJavaScriptEngine.csproj | 3 +- src/MsieJavaScriptEngine/Resources/json2.js | 39 ++++++++++++++++++- src/MsieJavaScriptEngine/readme.txt | 5 ++- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 96ed984..d9bd983 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,7 +25,8 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no longer used for embedding objects and types. + 1. In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no longer used for embedding objects and types; +2. JSON2 library was updated to version of October 30, 2022. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/Resources/json2.js b/src/MsieJavaScriptEngine/Resources/json2.js index f6fada6..adac444 100644 --- a/src/MsieJavaScriptEngine/Resources/json2.js +++ b/src/MsieJavaScriptEngine/Resources/json2.js @@ -1,5 +1,5 @@ // json2.js -// 2017-06-12 +// 2022-10-30 // Public Domain. // NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. @@ -231,6 +231,29 @@ if (typeof JSON !== "object") { } +// This variable is initialized with an empty array every time +// JSON.stringify() is invoked and checked by the str() function. It's +// used to keep references to object structures and capture cyclic +// objects. Every new object is checked for its existence in this +// array. If it's found it means the JSON object is cyclic and we have +// to stop execution and throw a TypeError accordingly the ECMA262 +// (see NOTE 1 by the link https://tc39.es/ecma262/#sec-json.stringify). + + var seen; + +// Emulate [].includes(). It's actual for old-fashioned JScript. + + function includes(array, value) { + var i; + for (i = 0; i < array.length; i += 1) { + if (value === array[i]) { + return true; + } + } + return false; + } + + function str(key, holder) { // Produce a string from holder[key]. @@ -295,6 +318,16 @@ if (typeof JSON !== "object") { return "null"; } +// Check the value is not circular object. Otherwise throw TypeError. + + if (includes(seen, value)) { + throw new TypeError("Converting circular structure to JSON"); + } + +// Keep the value for the further check on circular references. + + seen.push(value); + // Make an array to hold the partial results of stringifying this object value. gap += indent; @@ -428,6 +461,10 @@ if (typeof JSON !== "object") { throw new Error("JSON.stringify"); } +// Initialize the reference keeper. + + seen = []; + // Make a fake root object containing our value under the key of "". // Return the result of stringifying the value. diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 8599766..7b59921 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,8 +21,9 @@ ============= RELEASE NOTES ============= - In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no - longer used for embedding objects and types. + 1. In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are + no longer used for embedding objects and types; + 2. JSON2 library was updated to version of October 30, 2022. ============ PROJECT SITE From cb35c8db6092a1c25605a6fb59dd700ef01d3e14 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 6 Feb 2023 20:31:17 +0300 Subject: [PATCH 10/28] Version 3.1.0 --- CHANGELOG.md | 12 ++++--- LICENSE.txt | 2 +- README.md | 33 +++++++++---------- build/common.props | 2 +- .../MsieJavaScriptEngine.csproj | 4 +-- src/MsieJavaScriptEngine/Resources/ES5.js | 6 ++-- .../NetFrameworkStrings.ru-ru.Designer.cs | 0 src/MsieJavaScriptEngine/readme.txt | 10 +++--- .../MsieJavaScriptEngine.Benchmarks.csproj | 2 +- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- ...criptEngine.Test.ChakraActiveScript.csproj | 2 +- ...avaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- ...eJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 2 +- 15 files changed, 43 insertions(+), 40 deletions(-) delete mode 100644 src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-ru.Designer.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cdc77c..5c11bf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Change log ========== +## v3.1.0 - February 6, 2023 + * In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no longer used for embedding objects and types + * JSON2 library was updated to version of October 30, 2022 + ## v3.0.9 - July 20, 2022 * Now a case-sensitive cultural postfixes are used in the names of `.resx` files @@ -233,14 +237,14 @@ Change log * Fixed [JavaScriptEngineSwitcher.Msie's bug #7](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/7) "MsieJavaScriptEngine.ActiveScript.ActiveScriptException not wrapped" ## v1.4.2 - March 24, 2014 - * Fixed [JavaScriptEngineSwitcher.Msie's bug #5](http://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/5) "MSIE "Catastrophic failure" when disposing" + * Fixed [JavaScriptEngineSwitcher.Msie's bug #5](https://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/5) "MSIE "Catastrophic failure" when disposing" ## v1.4.1 - March 22, 2014 * Fixed minor bugs ## v1.4.0 - February 27, 2014 * Removed following methods: `HasProperty`, `GetPropertyValue`, `SetPropertyValue` and `RemoveProperty` - * Fixed [bug #3](http://github.com/Taritsyn/MsieJavaScriptEngine/issues/3) "execute code from different threads" + * Fixed [bug #3](https://github.com/Taritsyn/MsieJavaScriptEngine/issues/3) "execute code from different threads" * Now in the `ChakraJsRt` mode is available a more detailed information about errors * In ECMAScript 5 Polyfill improved a performance of the `String.prototype.trim` method * JSON2 library was updated to version of February 4, 2014 @@ -264,7 +268,7 @@ Change log * Assembly `MsieJavaScriptEngine.dll` now signed ## v1.1.0 - October 11, 2012 - * Added ability of using the Douglas Crockford's [JSON2](http://github.com/douglascrockford/JSON-js) library + * Added ability of using the Douglas Crockford's [JSON2](https://github.com/douglascrockford/JSON-js) library * By default using of the JSON2 library is disabled ## v1.0.8 - September 21, 2012 @@ -274,7 +278,7 @@ Change log * Added the `ActiveScriptErrorFormatter` class ## v1.0.5 - August 29, 2012 - * [JavaScript Array Polyfills from TutorialsPoint.com](http://www.tutorialspoint.com/javascript/) was replaced by the Douglas Crockford's [ECMAScript 5 Polyfill](http://nuget.org/packages/ES5) + * [JavaScript Array Polyfills from TutorialsPoint.com](https://www.tutorialspoint.com/javascript/) was replaced by the Douglas Crockford's [ECMAScript 5 Polyfill](https://www.nuget.org/packages/ES5) * By default using of the ECMAScript 5 Polyfill is disabled ## v1.0.1 - August 27, 2012 diff --git a/LICENSE.txt b/LICENSE.txt index 1b36598..55c4d50 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ - Copyright (c) 2012-2022 Andrey Taritsyn - http://www.taritsyn.ru + Copyright (c) 2012-2023 Andrey Taritsyn - http://www.taritsyn.ru Apache License Version 2.0, January 2004 diff --git a/README.md b/README.md index 9727a00..c152ac5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ MSIE JavaScript Engine for .NET [![NuGet version](http://img.shields.io/nuget/v/ ![MSIE JS Engine Logo](http://i.imgur.com/T3K5q.png) This project is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). -Project was based on the code of [SassAndCoffee.JavaScript](http://github.com/paulcbetts/SassAndCoffee), [Chakra Sample Hosts](http://github.com/panopticoncentral/chakra-host) and [jsrt-dotnet](http://github.com/robpaveza/jsrt-dotnet). +Project was based on the code of [SassAndCoffee.JavaScript](https://github.com/anaisbetts/SassAndCoffee), [Chakra Sample Hosts](https://github.com/panopticoncentral/chakra-host) and [jsrt-dotnet](https://github.com/robpaveza/jsrt-dotnet). MSIE JavaScript Engine requires a installation of Internet Explorer or Edge Legacy on the machine and can work in 5 modes, that are defined in the JsEngineMode enumeration: @@ -23,7 +23,7 @@ The supported .NET types are as follows: * `System.String` ## Installation -This library can be installed through NuGet - [http://nuget.org/packages/MsieJavaScriptEngine](http://nuget.org/packages/MsieJavaScriptEngine). +This library can be installed through NuGet - [https://www.nuget.org/packages/MsieJavaScriptEngine](https://www.nuget.org/packages/MsieJavaScriptEngine). ## Usage Consider a simple example of usage of the MSIE JavaScript Engine: @@ -134,7 +134,7 @@ Consider in detail properties of the Boolean false - Flag for whether to use the JSON2 library + Flag for whether to use the JSON2 library @@ -147,21 +147,20 @@ See the [changelog](CHANGELOG.md). [Apache License Version 2.0](LICENSE.md) ## Credits - * [SassAndCoffee.JavaScript](http://github.com/xpaulbettsx/SassAndCoffee) - [License: Microsoft Public License (Ms-PL)](http://github.com/paulcbetts/SassAndCoffee/blob/master/COPYING) Part of the code of this library served as the basis for the ActiveScript version of Chakra and Classic JavaScript Engine. - * [Chakra Sample Hosts](http://github.com/panopticoncentral/chakra-host) - [License: Apache License 2.0 (Apache)](http://github.com/panopticoncentral/chakra-host/blob/master/LICENSE) C# example from this project served as the basis for the JsRT versions of Chakra. - * [jsrt-dotnet](http://github.com/robpaveza/jsrt-dotnet) - [License: The MIT License (MIT)](http://github.com/robpaveza/jsrt-dotnet/blob/master/LICENSE) Part of the code of this library is used in the JsRT versions of Chakra. - * [ECMAScript 5 Polyfill](http://nuget.org/packages/ES5) and [MDN JavaScript Polyfills](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference) - Adds support for many of the new functions in ECMAScript 5 to downlevel browsers. - * [Cross-Browser Split](http://blog.stevenlevithan.com/archives/cross-browser-split) - Adds ECMAScript compliant and uniform cross-browser split method. - * [JSON2 library](http://github.com/douglascrockford/JSON-js) - Adds support of the JSON object from ECMAScript 5 to downlevel browsers. - * [Bundler and Minifier](http://github.com/madskristensen/BundlerMinifier) - [License: Apache License 2.0 (Apache)](http://github.com/madskristensen/BundlerMinifier/blob/master/LICENSE) JS-files, that used MSIE JS Engine, minificated by using this tool. + * [SassAndCoffee.JavaScript](https://github.com/anaisbetts/SassAndCoffee) - [License: Microsoft Public License (Ms-PL)](https://github.com/anaisbetts/SassAndCoffee/blob/master/COPYING) Part of the code of this library served as the basis for the ActiveScript version of Chakra and Classic JavaScript Engine. + * [Chakra Sample Hosts](https://github.com/panopticoncentral/chakra-host) - [License: Apache License 2.0 (Apache)](https://github.com/panopticoncentral/chakra-host/blob/master/LICENSE) C# example from this project served as the basis for the JsRT versions of Chakra. + * [jsrt-dotnet](https://github.com/robpaveza/jsrt-dotnet) - [License: The MIT License (MIT)](https://github.com/robpaveza/jsrt-dotnet/blob/master/LICENSE) Part of the code of this library is used in the JsRT versions of Chakra. + * [ECMAScript 5 Polyfill](https://www.nuget.org/packages/ES5) and [MDN JavaScript Polyfills](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference) - Adds support for many of the new functions in ECMAScript 5 to downlevel browsers. + * [Cross-Browser Split](https://blog.stevenlevithan.com/archives/cross-browser-split) - Adds ECMAScript compliant and uniform cross-browser split method. + * [JSON2 library](https://github.com/douglascrockford/JSON-js) - Adds support of the JSON object from ECMAScript 5 to downlevel browsers. + * [Bundler and Minifier](https://github.com/madskristensen/BundlerMinifier) - [License: Apache License 2.0 (Apache)](http://github.com/madskristensen/BundlerMinifier/blob/master/LICENSE) JS-files, that used MSIE JS Engine, minificated by using this tool. ## Who's Using MSIE JavaScript Engine If you use the MSIE JavaScript Engine in some project, please send me a message so I can include it in this list: - * [BitAdminCore.ALL](http://nuget.org/packages/BitAdminCore.ALL) - * [Chevron](http://github.com/SimonCropp/Chevron) by Simon Cropp - * [JavaScript Engine Switcher](http://github.com/Taritsyn/JavaScriptEngineSwitcher) by Andrey Taritsyn - * [PowerShell.JS](http://github.com/klumsy/powershellJS) by Karl Prosser - * [Serenity Application Platform](http://github.com/volkanceylan/Serenity) by Volkan Ceylan - * [SquishIt](http://github.com/jetheredge/SquishIt) by Justin Etheredge and Alex Ullrich - * [Strike](http://github.com/SimonCropp/Strike) by Simon Cropp \ No newline at end of file + * [BitAdminCore.ALL](https://www.nuget.org/packages/BitAdminCore.ALL) + * [Chevron](https://github.com/simoncropparchived/Chevron) by Simon Cropp + * [JavaScript Engine Switcher](https://github.com/Taritsyn/JavaScriptEngineSwitcher) by Andrey Taritsyn + * [PowerShell.JS](https://github.com/klumsy/powershellJS) by Karl Prosser + * [SquishIt](https://github.com/jetheredge/SquishIt) by Justin Etheredge and Alex Ullrich + * [Strike](https://github.com/simoncropparchived/Strike) by Simon Cropp \ No newline at end of file diff --git a/build/common.props b/build/common.props index d5c9126..96e62fb 100644 --- a/build/common.props +++ b/build/common.props @@ -1,5 +1,5 @@ - Copyright © 2012-2022 Andrey Taritsyn + Copyright © 2012-2023 Andrey Taritsyn \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index d9bd983..a11afff 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine for .NET - 3.0.9 + 3.1.0 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 7.3 @@ -13,7 +13,7 @@ true $(Product) Andrey Taritsyn - This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript (http://github.com/paulcbetts/SassAndCoffee), Chakra Sample Hosts (http://github.com/panopticoncentral/chakra-host) and jsrt-dotnet (http://github.com/robpaveza/jsrt-dotnet). + This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript (https://github.com/anaisbetts/SassAndCoffee), Chakra Sample Hosts (https://github.com/panopticoncentral/chakra-host) and jsrt-dotnet (https://github.com/robpaveza/jsrt-dotnet). LICENSE.txt false https://github.com/Taritsyn/MsieJavaScriptEngine diff --git a/src/MsieJavaScriptEngine/Resources/ES5.js b/src/MsieJavaScriptEngine/Resources/ES5.js index 9ff4f4c..821c180 100644 --- a/src/MsieJavaScriptEngine/Resources/ES5.js +++ b/src/MsieJavaScriptEngine/Resources/ES5.js @@ -1,8 +1,8 @@ /*! * This polyfill based on code of the following libraries: -* 1. Douglas Crockford's ECMAScript 5 Polyfill v0.1 - http://nuget.org/packages/ES5 -* 2. MDN JavaScript Polyfills - http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference -* 3. Steven Levithan's Cross-Browser Split v1.1.1 - http://blog.stevenlevithan.com/archives/cross-browser-split +* 1. Douglas Crockford's ECMAScript 5 Polyfill v0.1 - https://www.nuget.org/packages/ES5 +* 2. MDN JavaScript Polyfills - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference +* 3. Steven Levithan's Cross-Browser Split v1.1.1 - https://blog.stevenlevithan.com/archives/cross-browser-split */ (function (undefined) { diff --git a/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-ru.Designer.cs b/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.ru-ru.Designer.cs deleted file mode 100644 index e69de29..0000000 diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 7b59921..6827039 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,11 +1,11 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.0.9 + README file for MSIE JavaScript Engine for .NET v3.1.0 -------------------------------------------------------------------------------- - Copyright (c) 2012-2022 Andrey Taritsyn - http://www.taritsyn.ru + Copyright (c) 2012-2023 Andrey Taritsyn - http://www.taritsyn.ru =========== @@ -14,9 +14,9 @@ This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of - SassAndCoffee.JavaScript (http://github.com/paulcbetts/SassAndCoffee), - Chakra Sample Hosts (http://github.com/panopticoncentral/chakra-host) and - jsrt-dotnet (http://github.com/robpaveza/jsrt-dotnet). + SassAndCoffee.JavaScript (https://github.com/anaisbetts/SassAndCoffee), + Chakra Sample Hosts (https://github.com/panopticoncentral/chakra-host) and + jsrt-dotnet (https://github.com/robpaveza/jsrt-dotnet). ============= RELEASE NOTES diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index 86c8be2..c122933 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Benchmarks - 3.0.9 + 3.1.0 net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Exe true diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 18f1911..ef7fdd3 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.0.9 + 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index c5f970f..8bd96f8 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.0.9 + 3.1.0 net40;net45 Library true diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index f15fed9..b087cc1 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.0.9 + 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index dea7979..a6090e4 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.0.9 + 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index d3a58ce..beaee3e 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.0.9 + 3.1.0 net40;net45 Library true diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 85710b4..1398b23 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Common Tests - 3.0.9 + 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library true From efb2c6c6460d5c2a981066940b5798f322559d49 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Sun, 12 Feb 2023 19:40:43 +0300 Subject: [PATCH 11/28] Reformatted a XML documentation comments again --- .../Debugging/DebugStackFrameDescriptor.cs | 6 ++++-- src/MsieJavaScriptEngine/IInnerJsEngine.cs | 10 ++++++---- src/MsieJavaScriptEngine/InnerJsEngineBase.cs | 15 ++++++++++++++ src/MsieJavaScriptEngine/JsEngineSettings.cs | 3 +-- .../JsRt/Edge/EdgeJsContext.cs | 20 +++++++++++++------ .../JsRt/Edge/EdgeJsPropertyId.cs | 2 -- .../JsRt/Edge/EdgeJsRuntime.cs | 2 +- .../JsRt/Ie/IeJsContext.cs | 20 +++++++++++++------ .../JsRt/Ie/IeJsPropertyId.cs | 2 -- .../JsRt/Ie/IeJsRuntime.cs | 2 +- src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs | 4 ++-- .../JsRt/JsRuntimeAttributes.cs | 2 +- src/MsieJavaScriptEngine/MsieJsEngine.cs | 10 ++++++---- src/MsieJavaScriptEngine/ScriptDispatcher.cs | 2 +- src/MsieJavaScriptEngine/Utilities/Utils.cs | 2 +- 15 files changed, 67 insertions(+), 35 deletions(-) diff --git a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs index 45d2e46..4823b28 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/Debugging/DebugStackFrameDescriptor.cs @@ -7,9 +7,11 @@ namespace MsieJavaScriptEngine.ActiveScript.Debugging /// /// Enumerates stack frames and merges output from several enumerators on the same thread /// - /// The process debug manager uses this structure to sort the stack frames from + /// + /// The process debug manager uses this structure to sort the stack frames from /// multiple script engines. By convention, stacks grow down. Consequently, on architectures - /// where stacks grow up, the addresses should be twos-complemented. + /// where stacks grow up, the addresses should be twos-complemented. + /// [StructLayout(LayoutKind.Sequential)] internal struct DebugStackFrameDescriptor { diff --git a/src/MsieJavaScriptEngine/IInnerJsEngine.cs b/src/MsieJavaScriptEngine/IInnerJsEngine.cs index 040dcb8..6198864 100644 --- a/src/MsieJavaScriptEngine/IInnerJsEngine.cs +++ b/src/MsieJavaScriptEngine/IInnerJsEngine.cs @@ -57,7 +57,7 @@ internal interface IInnerJsEngine : IDisposable object CallFunction(string functionName, params object[] args); /// - /// Сhecks for the existence of a variable + /// Checks for the existence of a variable /// /// Name of variable /// Result of check (true - exists; false - not exists @@ -86,20 +86,22 @@ internal interface IInnerJsEngine : IDisposable /// /// Embeds a host object to script code /// + /// + /// Allows to embed instances of simple classes (or structures) and delegates. + /// /// The name for the new global variable or function that will represent the object /// The object to expose - /// Allows to embed instances of simple classes (or structures) and delegates. void EmbedHostObject(string itemName, object value); /// /// Embeds a host type to script code /// - /// The name for the new global variable that will represent the type - /// The type to expose /// /// Host types are exposed to script code in the form of objects whose properties and /// methods are bound to the type's static members. /// + /// The name for the new global variable that will represent the type + /// The type to expose void EmbedHostType(string itemName, Type type); /// diff --git a/src/MsieJavaScriptEngine/InnerJsEngineBase.cs b/src/MsieJavaScriptEngine/InnerJsEngineBase.cs index 2befbaf..e68123a 100644 --- a/src/MsieJavaScriptEngine/InnerJsEngineBase.cs +++ b/src/MsieJavaScriptEngine/InnerJsEngineBase.cs @@ -39,38 +39,53 @@ protected InnerJsEngineBase(JsEngineSettings settings) #region IInnerJsEngine implementation + /// public string Mode { get { return _engineModeName; } } + /// public abstract bool SupportsScriptPrecompilation { get; } + /// public abstract PrecompiledScript Precompile(string code, string documentName); + /// public abstract object Evaluate(string expression, string documentName); + /// public abstract void Execute(string code, string documentName); + /// public abstract void Execute(PrecompiledScript precompiledScript); + /// public abstract object CallFunction(string functionName, params object[] args); + /// public abstract bool HasVariable(string variableName); + /// public abstract object GetVariableValue(string variableName); + /// public abstract void SetVariableValue(string variableName, object value); + /// public abstract void RemoveVariable(string variableName); + /// public abstract void EmbedHostObject(string itemName, object value); + /// public abstract void EmbedHostType(string itemName, Type type); + /// public abstract void Interrupt(); + /// public abstract void CollectGarbage(); #endregion diff --git a/src/MsieJavaScriptEngine/JsEngineSettings.cs b/src/MsieJavaScriptEngine/JsEngineSettings.cs index f4b2094..85c0e6f 100644 --- a/src/MsieJavaScriptEngine/JsEngineSettings.cs +++ b/src/MsieJavaScriptEngine/JsEngineSettings.cs @@ -50,9 +50,8 @@ public JsEngineMode EngineMode /// Gets or sets a maximum stack size in bytes /// /// - /// Set a 0 to use the default maximum stack size specified in the header + /// Set a 0 to use the default maximum stack size specified in the header /// for the executable. - /// /// public int MaxStackSize { diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs index ffde72d..43027ea 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsContext.cs @@ -164,9 +164,13 @@ public static EdgeJsValue ParseScript(string script, JsSourceContext sourceConte /// Parses a serialized script and returns a function representing the script /// /// - /// Requires an active script context. - /// The runtime will hold on to the buffer until all instances of any functions created from - /// the buffer are garbage collected. + /// + /// Requires an active script context. + /// + /// + /// The runtime will hold on to the buffer until all instances of any functions created from + /// the buffer are garbage collected. + /// /// /// The script to parse /// The serialized script @@ -208,9 +212,13 @@ public static EdgeJsValue RunScript(string script, JsSourceContext sourceContext /// Runs a serialized script /// /// - /// Requires an active script context. - /// The runtime will hold on to the buffer until all instances of any functions created from - /// the buffer are garbage collected. + /// + /// Requires an active script context. + /// + /// + /// The runtime will hold on to the buffer until all instances of any functions created from + /// the buffer are garbage collected. + /// /// /// The source code of the serialized script /// The serialized script diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsPropertyId.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsPropertyId.cs index dcceaa9..3af5b25 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsPropertyId.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsPropertyId.cs @@ -29,9 +29,7 @@ public static EdgeJsPropertyId Invalid /// Gets a name associated with the property ID /// /// - /// /// Requires an active script context. - /// /// public string Name { diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs index 89d449e..e5f4b20 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeJsRuntime.cs @@ -15,7 +15,7 @@ namespace MsieJavaScriptEngine.JsRt.Edge /// time. /// /// - /// NOTE: A , unlike other objects in the Chakra hosting API, is not + /// NOTE: A , unlike other objects in the Chakra hosting API, is not /// garbage collected since it contains the garbage collected heap itself. A runtime will /// continue to exist until Dispose is called. /// diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs index 9c869bf..81dcb63 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsContext.cs @@ -167,9 +167,13 @@ public static IeJsValue ParseScript(string script, JsSourceContext sourceContext /// Parses a serialized script and returns a function representing the script /// /// - /// Requires an active script context. - /// The runtime will hold on to the buffer until all instances of any functions created from - /// the buffer are garbage collected. + /// + /// Requires an active script context. + /// + /// + /// The runtime will hold on to the buffer until all instances of any functions created from + /// the buffer are garbage collected. + /// /// /// The script to parse /// The serialized script @@ -211,9 +215,13 @@ public static IeJsValue RunScript(string script, JsSourceContext sourceContext, /// Runs a serialized script /// /// - /// Requires an active script context. - /// The runtime will hold on to the buffer until all instances of any functions created from - /// the buffer are garbage collected. + /// + /// Requires an active script context. + /// + /// + /// The runtime will hold on to the buffer until all instances of any functions created from + /// the buffer are garbage collected. + /// /// /// The source code of the serialized script /// The serialized script diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsPropertyId.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsPropertyId.cs index 12721bc..906c656 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsPropertyId.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsPropertyId.cs @@ -29,9 +29,7 @@ public static IeJsPropertyId Invalid /// Gets a name associated with the property ID /// /// - /// /// Requires an active script context. - /// /// public string Name { diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs index 6f183ca..33d518b 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeJsRuntime.cs @@ -18,7 +18,7 @@ namespace MsieJavaScriptEngine.JsRt.Ie /// time. /// /// - /// NOTE: A , unlike other objects in the Chakra hosting API, is not + /// NOTE: A , unlike other objects in the Chakra hosting API, is not /// garbage collected since it contains the garbage collected heap itself. A runtime will /// continue to exist until Dispose is called. /// diff --git a/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs b/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs index aa56c5c..b7ad833 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsErrorCode.cs @@ -77,7 +77,7 @@ public enum JsErrorCode : uint HeapEnumInProgress, /// - /// A hosting API that operates on Object values was called with a non-Object value + /// A hosting API that operates on object values was called with a non-object value /// ArgumentNotObject, @@ -150,7 +150,7 @@ public enum JsErrorCode : uint ScriptTerminated, /// - /// A script was terminated because it tried to use "eval" or "function" and eval was disabled + /// A script was terminated because it tried to use eval or Function and eval was disabled /// [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Eval is a valid function name.")] ScriptEvalDisabled, diff --git a/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs b/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs index cd0fdfd..a4c3536 100644 --- a/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs +++ b/src/MsieJavaScriptEngine/JsRt/JsRuntimeAttributes.cs @@ -27,7 +27,7 @@ internal enum JsRuntimeAttributes AllowScriptInterrupt = 0x00000002, /// - /// Host will call Idle, so enable idle processing. Otherwise, the runtime will manage + /// Host will call Idle, so enable idle processing. Otherwise, the runtime will manage /// memory slightly more aggressively. /// EnableIdleProcessing = 0x00000004, diff --git a/src/MsieJavaScriptEngine/MsieJsEngine.cs b/src/MsieJavaScriptEngine/MsieJsEngine.cs index 93f21b9..e807c48 100644 --- a/src/MsieJavaScriptEngine/MsieJsEngine.cs +++ b/src/MsieJavaScriptEngine/MsieJsEngine.cs @@ -1044,7 +1044,7 @@ public T CallFunction(string functionName, params object[] args) } /// - /// Сhecks for the existence of a variable + /// Checks for the existence of a variable /// /// Name of variable /// Result of check (true - exists; false - not exists @@ -1276,9 +1276,11 @@ public void RemoveVariable(string variableName) /// /// Embeds a host object to script code /// + /// + /// Allows to embed instances of simple classes (or structures) and delegates. + /// /// The name for the new global variable or function that will represent the object /// The object to expose - /// Allows to embed instances of simple classes (or structures) and delegates. /// /// /// @@ -1336,12 +1338,12 @@ public void EmbedHostObject(string itemName, object value) /// /// Embeds a host type to script code /// - /// The name for the new global variable that will represent the type - /// The type to expose /// /// Host types are exposed to script code in the form of objects whose properties and /// methods are bound to the type's static members. /// + /// The name for the new global variable that will represent the type + /// The type to expose /// /// /// diff --git a/src/MsieJavaScriptEngine/ScriptDispatcher.cs b/src/MsieJavaScriptEngine/ScriptDispatcher.cs index 4cdbdf2..d3ba763 100644 --- a/src/MsieJavaScriptEngine/ScriptDispatcher.cs +++ b/src/MsieJavaScriptEngine/ScriptDispatcher.cs @@ -150,7 +150,7 @@ private void ExecuteTask(ScriptTask task) /// /// Runs a specified delegate on the thread with modified stack size, - /// and returns its result as an . + /// and returns its result as an . /// Blocks until the invocation of delegate is completed. /// /// The type of the return value of the method, diff --git a/src/MsieJavaScriptEngine/Utilities/Utils.cs b/src/MsieJavaScriptEngine/Utilities/Utils.cs index 7acb73a..0c6838a 100644 --- a/src/MsieJavaScriptEngine/Utilities/Utils.cs +++ b/src/MsieJavaScriptEngine/Utilities/Utils.cs @@ -31,7 +31,7 @@ public static bool Is64BitProcess() /// /// The case-sensitive resource name /// The assembly, which contains the embedded resource - /// Сontent of the embedded resource as string + /// Content of the embedded resource as string public static string GetResourceAsString(string resourceName, Assembly assembly) { if (resourceName == null) From a61ba63a5fff5858c2999f8813fbda96db4d66c5 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Sun, 12 Feb 2023 19:43:35 +0300 Subject: [PATCH 12/28] Fixed a minor flaws --- src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 2 +- .../Resources/CommonStrings.Designer.cs | 10 +++++----- src/MsieJavaScriptEngine/Resources/CommonStrings.resx | 10 +++++----- .../CommonTestsBase.cs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index a11afff..41e1e91 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -83,7 +83,7 @@ - + diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs b/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs index 4d846c4..1154f28 100644 --- a/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs +++ b/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs @@ -410,7 +410,7 @@ internal static string Runtime_SuitableMethodOfHostObjectNotFound } /// - /// Looks up a localized string similar to "Сannot execute a '{0}' file, because it is empty." + /// Looks up a localized string similar to "Cannot execute a '{0}' file, because it is empty." /// internal static string Usage_CannotExecuteEmptyFile { @@ -418,7 +418,7 @@ internal static string Usage_CannotExecuteEmptyFile } /// - /// Looks up a localized string similar to "Сannot execute a '{0}' resource, because it is empty." + /// Looks up a localized string similar to "Cannot execute a '{0}' resource, because it is empty." /// internal static string Usage_CannotExecuteEmptyResource { @@ -426,7 +426,7 @@ internal static string Usage_CannotExecuteEmptyResource } /// - /// Looks up a localized string similar to "Сannot execute a pre-compiled script, because it was created for another mode with name `{0}`." + /// Looks up a localized string similar to "Cannot execute a pre-compiled script, because it was created for another mode with name `{0}`." /// internal static string Usage_CannotExecutePrecompiledScriptForAnotherJsEngineMode { @@ -434,7 +434,7 @@ internal static string Usage_CannotExecutePrecompiledScriptForAnotherJsEngineMod } /// - /// Looks up a localized string similar to "Сannot pre-compile a '{0}' file, because it is empty." + /// Looks up a localized string similar to "Cannot pre-compile a '{0}' file, because it is empty." /// internal static string Usage_CannotPrecompileEmptyFile { @@ -442,7 +442,7 @@ internal static string Usage_CannotPrecompileEmptyFile } /// - /// Looks up a localized string similar to "Сannot pre-compile a '{0}' resource, because it is empty." + /// Looks up a localized string similar to "Cannot pre-compile a '{0}' resource, because it is empty." /// internal static string Usage_CannotPrecompileEmptyResource { diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.resx b/src/MsieJavaScriptEngine/Resources/CommonStrings.resx index 6f41f9e..e950347 100644 --- a/src/MsieJavaScriptEngine/Resources/CommonStrings.resx +++ b/src/MsieJavaScriptEngine/Resources/CommonStrings.resx @@ -250,19 +250,19 @@ Could not find suitable method or not enough arguments to invoke of '{0}' method of the host object. - Сannot execute a '{0}' file, because it is empty. + Cannot execute a '{0}' file, because it is empty. - Сannot execute a '{0}' resource, because it is empty. + Cannot execute a '{0}' resource, because it is empty. - Сannot execute a pre-compiled script, because it was created for another mode with name `{0}`. + Cannot execute a pre-compiled script, because it was created for another mode with name `{0}`. - Сannot pre-compile a '{0}' file, because it is empty. + Cannot pre-compile a '{0}' file, because it is empty. - Сannot pre-compile a '{0}' resource, because it is empty. + Cannot pre-compile a '{0}' resource, because it is empty. The embedded host object '{0}' has a type `{1}`, which is not supported. diff --git a/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs index 666be5f..9559651 100644 --- a/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs @@ -977,7 +977,7 @@ public virtual void RemovingVariableWithNameContainingUnicodeCharacters() public virtual void ScriptInterruption() { // Arrange - const string sleepyСode = @"function sleep(millisecondsTimeout) { + const string sleepyCode = @"function sleep(millisecondsTimeout) { var totalMilliseconds = new Date().getTime() + millisecondsTimeout; while (new Date() < totalMilliseconds) @@ -1008,7 +1008,7 @@ public virtual void ScriptInterruption() try { - jsEngine.Execute(sleepyСode); + jsEngine.Execute(sleepyCode); } catch (Exception e) { From 0deec16fc448fb10c753a47f19538050a71ab339 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Sun, 26 Feb 2023 15:37:52 +0300 Subject: [PATCH 13/28] In JavaScript engine settings was added one new property - `AllowReflection` (default `false`) --- build-js.cmd | 34 +++++ global.json | 2 +- src/MsieJavaScriptEngine/.uglifyjsrc | 11 ++ .../ActiveScript/ActiveScriptJsEngineBase.cs | 6 +- .../ActiveScript/HostItemBase.cs | 60 +++++++- .../ActiveScript/HostObject.cs | 7 +- .../ActiveScript/HostType.cs | 7 +- .../Helpers/ReflectionHelpers.cs | 82 ++++++++--- .../Helpers/TypeMappingHelpers.cs | 10 +- src/MsieJavaScriptEngine/JsEngineSettings.cs | 14 ++ .../JsRt/Edge/ChakraEdgeJsRtJsEngine.cs | 2 +- .../JsRt/Edge/EdgeTypeMapper.cs | 16 +- .../JsRt/Ie/ChakraIeJsRtJsEngine.cs | 2 +- .../JsRt/Ie/IeTypeMapper.cs | 16 +- src/MsieJavaScriptEngine/JsRt/TypeMapper.cs | 41 ++++++ .../MsieJavaScriptEngine.csproj | 10 +- src/MsieJavaScriptEngine/bundleconfig.json | 14 -- src/MsieJavaScriptEngine/package.json | 12 ++ src/MsieJavaScriptEngine/readme.txt | 5 +- .../MsieJavaScriptEngine.Benchmarks.csproj | 2 +- .../InteropTests.cs | 40 +++++ .../MsieJavaScriptEngine.Test.Auto.csproj | 9 +- .../CommonTests.cs | 6 +- .../InteropTests.cs | 30 ++++ ...criptEngine.Test.ChakraActiveScript.csproj | 1 + .../CommonTests.cs | 6 +- .../InteropTests.cs | 25 ---- ...avaScriptEngine.Test.ChakraEdgeJsRt.csproj | 9 +- .../CommonTests.cs | 6 +- .../InteropTests.cs | 25 ---- ...eJavaScriptEngine.Test.ChakraIeJsRt.csproj | 9 +- .../CommonTests.cs | 6 +- .../InteropTests.cs | 113 +++++++++++++++ .../MsieJavaScriptEngine.Test.Classic.csproj | 1 + .../Interop/LoginFailedException.cs | 50 +++++++ .../InteropTestsBase.cs | 137 +++++++++++++++++- .../MsieJavaScriptEngine.Test.Common.csproj | 10 +- .../TestsBase.cs | 8 +- 38 files changed, 696 insertions(+), 148 deletions(-) create mode 100644 build-js.cmd create mode 100644 src/MsieJavaScriptEngine/.uglifyjsrc delete mode 100644 src/MsieJavaScriptEngine/bundleconfig.json create mode 100644 src/MsieJavaScriptEngine/package.json create mode 100644 test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs diff --git a/build-js.cmd b/build-js.cmd new file mode 100644 index 0000000..1e607da --- /dev/null +++ b/build-js.cmd @@ -0,0 +1,34 @@ +@echo off +setlocal + +cd ./src/MsieJavaScriptEngine/ + +::-------------------------------------------------------------------------------- +:: Build +::-------------------------------------------------------------------------------- + +echo Installing Node.js packages ... +echo. +call npm install +if errorlevel 1 goto error +echo. + +echo Minifying JS files ... +echo. +call npm run -s minify-js +if errorlevel 1 goto error +echo. + +::-------------------------------------------------------------------------------- +:: Exit +::-------------------------------------------------------------------------------- + +echo Succeeded! +goto exit + +:error +echo *** Error: The previous step failed! + +:exit +cd ../../ +endlocal \ No newline at end of file diff --git a/global.json b/global.json index 9b92080..4347eeb 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.102" + "version": "7.0.200" } } diff --git a/src/MsieJavaScriptEngine/.uglifyjsrc b/src/MsieJavaScriptEngine/.uglifyjsrc new file mode 100644 index 0000000..8a91584 --- /dev/null +++ b/src/MsieJavaScriptEngine/.uglifyjsrc @@ -0,0 +1,11 @@ +{ + "compress": { + "hoist_funs": true, + "hoist_vars": true, + "passes": 2 + }, + "mangle": {}, + "output": { + "comments": "/^!/" + } +} diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs index 1b71fa8..eeabc4e 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs @@ -571,7 +571,7 @@ private void InnerCollectGarbage(ScriptGCType type) /// The mapped value private object MapToScriptType(object value) { - return TypeMappingHelpers.MapToScriptType(value, _settings.EngineMode); + return TypeMappingHelpers.MapToScriptType(value, _settings.EngineMode, _settings.AllowReflection); } /// @@ -581,7 +581,7 @@ private object MapToScriptType(object value) /// The mapped array private object[] MapToScriptType(object[] args) { - return TypeMappingHelpers.MapToScriptType(args, _settings.EngineMode); + return TypeMappingHelpers.MapToScriptType(args, _settings.EngineMode, _settings.AllowReflection); } /// @@ -900,7 +900,7 @@ public override void EmbedHostObject(string itemName, object value) public override void EmbedHostType(string itemName, Type type) { - var typeValue = new HostType(type, _settings.EngineMode); + var typeValue = new HostType(type, _settings.EngineMode, _settings.AllowReflection); _dispatcher.Invoke(() => { diff --git a/src/MsieJavaScriptEngine/ActiveScript/HostItemBase.cs b/src/MsieJavaScriptEngine/ActiveScript/HostItemBase.cs index 5e9cbf7..7d0b945 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/HostItemBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/HostItemBase.cs @@ -27,6 +27,11 @@ internal abstract class HostItemBase : IReflect /// protected readonly JsEngineMode _engineMode; + /// + /// Flag for whether to allow the usage of reflection API in the script code + /// + protected readonly bool _allowReflection; + /// /// List of fields /// @@ -57,20 +62,26 @@ public object Target /// Target type /// Target object /// JS engine mode + /// Flag for whether to allow the usage of reflection API in the script code /// Flag for whether to allow access to members of the instance - protected HostItemBase(Type type, object target, JsEngineMode engineMode, bool instance) + protected HostItemBase(Type type, object target, JsEngineMode engineMode, bool allowReflection, bool instance) { _type = type; _target = target; + _allowReflection = allowReflection; _engineMode = engineMode; BindingFlags defaultBindingFlags = ReflectionHelpers.GetDefaultBindingFlags(instance); FieldInfo[] fields = _type.GetFields(defaultBindingFlags); PropertyInfo[] properties = _type.GetProperties(defaultBindingFlags); + if (properties.Length > 0 && !allowReflection) + { + properties = GetAvailableProperties(properties); + } MethodInfo[] methods = _type.GetMethods(defaultBindingFlags); - if (methods.Length > 0 && properties.Length > 0) + if (methods.Length > 0 && (properties.Length > 0 || !allowReflection)) { - methods = ReflectionHelpers.GetFullyFledgedMethods(methods); + methods = GetAvailableMethods(methods, allowReflection); } _fields = fields; @@ -79,6 +90,49 @@ protected HostItemBase(Type type, object target, JsEngineMode engineMode, bool i } + private static PropertyInfo[] GetAvailableProperties(PropertyInfo[] properties) + { + int propertyCount = properties.Length; + var availableProperties = new PropertyInfo[propertyCount]; + int availablePropertyIndex = 0; + + for (int propertyIndex = 0; propertyIndex < propertyCount; propertyIndex++) + { + PropertyInfo property = properties[propertyIndex]; + if (ReflectionHelpers.IsAllowedProperty(property)) + { + availableProperties[availablePropertyIndex] = property; + availablePropertyIndex++; + } + } + + Array.Resize(ref availableProperties, availablePropertyIndex); + + return availableProperties; + } + + private static MethodInfo[] GetAvailableMethods(MethodInfo[] methods, bool allowReflection) + { + int methodCount = methods.Length; + var availableMethods = new MethodInfo[methodCount]; + int availableMethodIndex = 0; + + for (int methodIndex = 0; methodIndex < methodCount; methodIndex++) + { + MethodInfo method = methods[methodIndex]; + if (ReflectionHelpers.IsFullyFledgedMethod(method) + && (allowReflection || ReflectionHelpers.IsAllowedMethod(method))) + { + availableMethods[availableMethodIndex] = method; + availableMethodIndex++; + } + } + + Array.Resize(ref availableMethods, availableMethodIndex); + + return availableMethods; + } + private bool IsField(string name) { bool isField = false; diff --git a/src/MsieJavaScriptEngine/ActiveScript/HostObject.cs b/src/MsieJavaScriptEngine/ActiveScript/HostObject.cs index fd91ba0..cb00656 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/HostObject.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/HostObject.cs @@ -25,8 +25,9 @@ internal sealed class HostObject : HostItemBase /// /// Target object /// JS engine mode - public HostObject(object target, JsEngineMode engineMode) - : base(target.GetType(), target, engineMode, true) + /// Flag for whether to allow the usage of reflection API in the script code + public HostObject(object target, JsEngineMode engineMode, bool allowReflection) + : base(target.GetType(), target, engineMode, allowReflection, true) { var del = _target as Delegate; if (del != null) @@ -88,7 +89,7 @@ protected override object InnerInvokeMember(string name, BindingFlags invokeAttr processedArgs, modifiers, culture, namedParameters); } - return TypeMappingHelpers.MapToScriptType(result, _engineMode); + return TypeMappingHelpers.MapToScriptType(result, _engineMode, _allowReflection); } #endregion diff --git a/src/MsieJavaScriptEngine/ActiveScript/HostType.cs b/src/MsieJavaScriptEngine/ActiveScript/HostType.cs index 0071c0b..855d02d 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/HostType.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/HostType.cs @@ -19,8 +19,9 @@ internal sealed class HostType : HostItemBase /// /// Target type /// JS engine mode - public HostType(Type type, JsEngineMode engineMode) - : base(type, null, engineMode, false) + /// Flag for whether to allow the usage of reflection API in the script code + public HostType(Type type, JsEngineMode engineMode, bool allowReflection) + : base(type, null, engineMode, allowReflection, false) { } @@ -51,7 +52,7 @@ protected override object InnerInvokeMember(string name, BindingFlags invokeAttr processedArgs, modifiers, culture, namedParameters); } - return TypeMappingHelpers.MapToScriptType(result, _engineMode); + return TypeMappingHelpers.MapToScriptType(result, _engineMode, _allowReflection); } #endregion diff --git a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs index 0f37cf5..304edc0 100644 --- a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs @@ -12,6 +12,19 @@ namespace MsieJavaScriptEngine.Helpers /// internal static class ReflectionHelpers { + private static readonly PropertyInfo[] _disallowedProperties = + { + typeof(Delegate).GetProperty("Method"), + typeof(Exception).GetProperty("TargetSite") + }; + + private static readonly MethodInfo[] _disallowedMethods = + { + typeof(object).GetMethod("GetType"), + typeof(Exception).GetMethod("GetType") + }; + + public static BindingFlags GetDefaultBindingFlags(bool instance) { BindingFlags bindingFlags = BindingFlags.Public; @@ -27,6 +40,20 @@ public static BindingFlags GetDefaultBindingFlags(bool instance) return bindingFlags; } + public static bool IsAllowedProperty(PropertyInfo property) + { + bool isAllowed = !_disallowedProperties.Contains(property, MemberComparer.Instance); + + return isAllowed; + } + + public static bool IsAllowedMethod(MethodInfo method) + { + bool isAllowed = !_disallowedMethods.Contains(method, MemberComparer.Instance); + + return isAllowed; + } + public static bool IsFullyFledgedMethod(MethodInfo method) { if (!method.Attributes.HasFlag(MethodAttributes.SpecialName)) @@ -40,29 +67,6 @@ public static bool IsFullyFledgedMethod(MethodInfo method) return isFullyFledged; } -#if NETFRAMEWORK - - public static MethodInfo[] GetFullyFledgedMethods(MethodInfo[] methods) - { - int methodCount = methods.Length; - var fullyFledgedMethods = new MethodInfo[methodCount]; - int fullyFledgedMethodIndex = 0; - - for (int methodIndex = 0; methodIndex < methodCount; methodIndex++) - { - MethodInfo method = methods[methodIndex]; - if (IsFullyFledgedMethod(method)) - { - fullyFledgedMethods[fullyFledgedMethodIndex] = method; - fullyFledgedMethodIndex++; - } - } - - Array.Resize(ref fullyFledgedMethods, fullyFledgedMethodIndex); - - return fullyFledgedMethods; - } -#endif public static void FixFieldValueType(ref object value, FieldInfo field) { @@ -244,6 +248,38 @@ private static bool CompareParameterTypes(object[] argValues, Type[] argTypes, T } + private sealed class MemberComparer : EqualityComparer + where T : MemberInfo + { + public static MemberComparer Instance { get; } = new MemberComparer(); + + + private MemberComparer() + { } + + + #region MemberComparer overrides + + public override bool Equals(T x, T y) + { + return x.Module == y.Module +#if !NETSTANDARD1_3 + && x.MetadataToken == y.MetadataToken +#else + && x.DeclaringType == y.DeclaringType + && x.Name == y.Name +#endif + ; + } + + public override int GetHashCode(T obj) + { + return obj != null ? obj.GetHashCode() : 0; + } + + #endregion + } + private sealed class MethodWithMetadata { public MethodBase Method diff --git a/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs b/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs index 424f45a..843ef9c 100644 --- a/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/TypeMappingHelpers.cs @@ -17,8 +17,9 @@ internal static class TypeMappingHelpers /// /// The source value /// JavaScript engine mode + /// Flag for whether to allow the usage of reflection API in the script code /// The mapped value - public static object MapToScriptType(object value, JsEngineMode engineMode) + public static object MapToScriptType(object value, JsEngineMode engineMode, bool allowReflection) { if (value == null) { @@ -36,7 +37,7 @@ public static object MapToScriptType(object value, JsEngineMode engineMode) return value; } - var result = new HostObject(value, engineMode); + var result = new HostObject(value, engineMode, allowReflection); return result; } @@ -46,10 +47,11 @@ public static object MapToScriptType(object value, JsEngineMode engineMode) /// /// The source array /// JavaScript engine mode + /// Flag for whether to allow the usage of reflection API in the script code /// The mapped array - public static object[] MapToScriptType(object[] args, JsEngineMode engineMode) + public static object[] MapToScriptType(object[] args, JsEngineMode engineMode, bool allowReflection) { - return args.Select(arg => MapToScriptType(arg, engineMode)).ToArray(); + return args.Select(arg => MapToScriptType(arg, engineMode, allowReflection)).ToArray(); } /// diff --git a/src/MsieJavaScriptEngine/JsEngineSettings.cs b/src/MsieJavaScriptEngine/JsEngineSettings.cs index 85c0e6f..ff92ee5 100644 --- a/src/MsieJavaScriptEngine/JsEngineSettings.cs +++ b/src/MsieJavaScriptEngine/JsEngineSettings.cs @@ -27,6 +27,19 @@ public sealed class JsEngineSettings private int _maxStackSize; #endif + /// + /// Gets or sets a flag for whether to allow the usage of reflection API in the script code + /// + /// + /// This affects , Exception.GetType, + /// Exception.TargetSite and Delegate.Method. + /// + public bool AllowReflection + { + get; + set; + } + /// /// Gets or sets a flag for whether to enable script debugging features /// @@ -95,6 +108,7 @@ public bool UseJson2Library /// public JsEngineSettings() { + AllowReflection = false; EnableDebugging = false; EngineMode = JsEngineMode.Auto; #if !NETSTANDARD1_3 diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs b/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs index d7271ac..7ed6c07 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/ChakraEdgeJsRtJsEngine.cs @@ -61,7 +61,7 @@ internal sealed class ChakraEdgeJsRtJsEngine : ChakraJsRtJsEngineBase public ChakraEdgeJsRtJsEngine(JsEngineSettings settings) : base(settings) { - _typeMapper = new EdgeTypeMapper(); + _typeMapper = new EdgeTypeMapper(settings.AllowReflection); try { diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs index 37ca65b..eabfe7a 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs @@ -26,7 +26,9 @@ internal sealed class EdgeTypeMapper : TypeMapper /// Constructs an instance of the “Edge” type mapper /// - public EdgeTypeMapper() + /// Flag for whether to allow the usage of reflection API in the script code + public EdgeTypeMapper(bool allowReflection) + : base(allowReflection) { } @@ -437,6 +439,11 @@ private void ProjectProperties(EdgeEmbeddedItem externalItem) foreach (PropertyInfo property in properties) { + if (!IsAvailableProperty(property)) + { + continue; + } + string propertyName = property.Name; EdgeJsValue descriptorValue = EdgeJsValue.CreateObject(); @@ -565,11 +572,10 @@ private void ProjectMethods(EdgeEmbeddedItem externalItem) string typeName = type.FullName; BindingFlags defaultBindingFlags = ReflectionHelpers.GetDefaultBindingFlags(instance); - IEnumerable methods = type.GetMethods(defaultBindingFlags) - .Where(ReflectionHelpers.IsFullyFledgedMethod); - IEnumerable> methodGroups = methods.GroupBy(m => m.Name); + MethodInfo[] methods = type.GetMethods(defaultBindingFlags); + IEnumerable> availableMethodGroups = GetAvailableMethodGroups(methods); - foreach (IGrouping methodGroup in methodGroups) + foreach (IGrouping methodGroup in availableMethodGroups) { string methodName = methodGroup.Key; MethodInfo[] methodCandidates = methodGroup.ToArray(); diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs b/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs index 11fddd7..c405866 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/ChakraIeJsRtJsEngine.cs @@ -69,7 +69,7 @@ internal sealed class ChakraIeJsRtJsEngine : ChakraJsRtJsEngineBase public ChakraIeJsRtJsEngine(JsEngineSettings settings) : base(settings) { - _typeMapper = new IeTypeMapper(); + _typeMapper = new IeTypeMapper(settings.AllowReflection); try { diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs index 5d50d7c..a3e4944 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs @@ -26,7 +26,9 @@ internal sealed class IeTypeMapper : TypeMapper /// /// Constructs an instance of the “IE” type mapper /// - public IeTypeMapper() + /// Flag for whether to allow the usage of reflection API in the script code + public IeTypeMapper(bool allowReflection) + : base(allowReflection) { } @@ -437,6 +439,11 @@ private void ProjectProperties(IeEmbeddedItem externalItem) foreach (PropertyInfo property in properties) { + if (!IsAvailableProperty(property)) + { + continue; + } + string propertyName = property.Name; IeJsValue descriptorValue = IeJsValue.CreateObject(); @@ -565,11 +572,10 @@ private void ProjectMethods(IeEmbeddedItem externalItem) string typeName = type.FullName; BindingFlags defaultBindingFlags = ReflectionHelpers.GetDefaultBindingFlags(instance); - IEnumerable methods = type.GetMethods(defaultBindingFlags) - .Where(ReflectionHelpers.IsFullyFledgedMethod); - IEnumerable> methodGroups = methods.GroupBy(m => m.Name); + MethodInfo[] methods = type.GetMethods(defaultBindingFlags); + IEnumerable> availableMethodGroups = GetAvailableMethodGroups(methods); - foreach (IGrouping methodGroup in methodGroups) + foreach (IGrouping methodGroup in availableMethodGroups) { string methodName = methodGroup.Key; MethodInfo[] methodCandidates = methodGroup.ToArray(); diff --git a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs index a4a50f6..8615e09 100644 --- a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs @@ -1,9 +1,11 @@ using System; using System.Collections.Concurrent; +using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; +using MsieJavaScriptEngine.Helpers; using MsieJavaScriptEngine.JsRt.Embedding; using MsieJavaScriptEngine.Utilities; @@ -23,6 +25,11 @@ internal abstract class TypeMapper : IDisposable /// protected const string ExternalObjectPropertyName = "_MsieJavaScriptEngine_externalObject"; + /// + /// Flag for whether to allow the usage of reflection API in the script code + /// + protected readonly bool _allowReflection; + /// /// Storage for lazy-initialized embedded objects /// @@ -69,6 +76,16 @@ internal abstract class TypeMapper : IDisposable private InterlockedStatedFlag _disposedFlag = new InterlockedStatedFlag(); + /// + /// Constructs an instance of the type mapper + /// + /// Flag for whether to allow the usage of reflection API in the script code + protected TypeMapper(bool allowReflection) + { + _allowReflection = allowReflection; + } + + /// /// Creates a JavaScript value from an host object if the it does not already exist /// @@ -200,6 +217,30 @@ private void EmbeddedTypeFinalizeCallback(IntPtr ptr) embeddedTypeHandle.Free(); } + protected bool IsAvailableProperty(PropertyInfo property) + { + if (_allowReflection) + { + return true; + } + + bool isAvailable = ReflectionHelpers.IsAllowedProperty(property); + + return isAvailable; + } + + protected IEnumerable> GetAvailableMethodGroups(MethodInfo[] methods) + { + IEnumerable availableMethods = methods.Where(ReflectionHelpers.IsFullyFledgedMethod); + if (!_allowReflection) + { + availableMethods = availableMethods.Where(ReflectionHelpers.IsAllowedMethod); + } + IEnumerable> availableMethodGroups = availableMethods.GroupBy(m => m.Name); + + return availableMethodGroups; + } + protected object[] GetHostItemMemberArguments(TValue[] args, int maxArgCount = -1) { if (args == null) diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 41e1e91..72acc70 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,8 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - 1. In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no longer used for embedding objects and types; -2. JSON2 library was updated to version of October 30, 2022. + In JavaScript engine settings was added one new property - `AllowReflection` (default `false`). en-US ../../nuget true @@ -40,7 +39,6 @@ - @@ -87,4 +85,10 @@ + + + + \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/bundleconfig.json b/src/MsieJavaScriptEngine/bundleconfig.json deleted file mode 100644 index 9153a95..0000000 --- a/src/MsieJavaScriptEngine/bundleconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "outputFileName": "Resources/ES5.min.js", - "inputFiles": [ - "Resources/ES5.js" - ] - }, - { - "outputFileName": "Resources/json2.min.js", - "inputFiles": [ - "Resources/json2.js" - ] - } -] diff --git a/src/MsieJavaScriptEngine/package.json b/src/MsieJavaScriptEngine/package.json new file mode 100644 index 0000000..381dbb5 --- /dev/null +++ b/src/MsieJavaScriptEngine/package.json @@ -0,0 +1,12 @@ +{ + "name": "MsieJavaScriptEngine", + "version": "3.1.0", + "devDependencies": { + "uglify-js": "3.16.1" + }, + "scripts": { + "minify-es5-js": "uglifyjs ./Resources/ES5.js --output ./Resources/ES5.min.js --config-file ./.uglifyjsrc", + "minify-json2-js": "uglifyjs ./Resources/json2.js --output ./Resources/json2.min.js --config-file ./.uglifyjsrc", + "minify-js": "npm run -s minify-es5-js && npm run -s minify-json2-js" + } +} diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 6827039..319849c 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,9 +21,8 @@ ============= RELEASE NOTES ============= - 1. In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are - no longer used for embedding objects and types; - 2. JSON2 library was updated to version of October 30, 2022. + In JavaScript engine settings was added one new property - `AllowReflection` + (default `false`). ============ PROJECT SITE diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index c122933..674cebb 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -21,7 +21,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Auto/InteropTests.cs b/test/MsieJavaScriptEngine.Test.Auto/InteropTests.cs index c6e4def..3034802 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.Auto/InteropTests.cs @@ -8,5 +8,45 @@ namespace MsieJavaScriptEngine.Test.Auto public class InteropTests : InteropTestsBase { protected override JsEngineMode EngineMode => JsEngineMode.Auto; + + + #region Embedding of objects + + #region Objects with methods + + public override void EmbeddingOfInstanceOfCustomValueTypeAndCallingOfItsGetTypeMethod() + { } + + public override void EmbeddingOfInstanceOfCustomReferenceTypeAndCallingOfItsGetTypeMethod() + { } + + #endregion + + #region Delegates + + public override void EmbeddingOfInstanceOfDelegateAndCheckingItsPrototype() + { } + + public override void EmbeddingOfInstanceOfDelegateAndGettingItsMethodProperty() + { } + + #endregion + + #endregion + + + #region Embedding of types + + #region Creating of instances + + public override void CreatingAnInstanceOfEmbeddedBuiltinExceptionAndGettingItsTargetSiteProperty() + { } + + public override void CreatingAnInstanceOfEmbeddedCustomExceptionAndCallingOfItsGetTypeMethod() + { } + + #endregion + + #endregion } } \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index ef7fdd3..7748d17 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -5,6 +5,7 @@ 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library + latest true true false @@ -14,9 +15,15 @@ + + + + + - + + \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs index a3d4893..b33e52e 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/CommonTests.cs @@ -65,7 +65,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -186,7 +186,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -300,7 +300,7 @@ public void GenerationOfCompilationErrorMessageInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs index d6c6443..432f127 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/InteropTests.cs @@ -4,6 +4,7 @@ using NUnit.Framework; using MsieJavaScriptEngine.Test.Common; +using MsieJavaScriptEngine.Test.Common.Interop.Animals; namespace MsieJavaScriptEngine.Test.ChakraActiveScript { @@ -15,6 +16,35 @@ public class InteropTests : InteropTestsBase #region Embedding of objects + #region Delegates + + [Test] + public override void EmbeddingOfInstanceOfDelegateAndCheckingItsPrototype() + { } + + [Test] + public override void EmbeddingOfInstanceOfDelegateAndGettingItsMethodProperty() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + var cat = new Cat(); + var cryFunc = new Func(cat.Cry); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostObject("cry", cryFunc); + return jsEngine.Evaluate("cry.Method;"); + } + } + + // Act and Assert + Assert.AreEqual("System.String Cry()", TestAllowReflectionSetting(true)); + Assert.AreEqual("undefined", TestAllowReflectionSetting(false)); + } + + #endregion + #region Recursive calls #region Mapping of errors diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index 8bd96f8..3ba8b43 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -5,6 +5,7 @@ 3.1.0 net40;net45 Library + latest true true false diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs index 8549729..09acc27 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/CommonTests.cs @@ -66,7 +66,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -187,7 +187,7 @@ public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -305,7 +305,7 @@ public void GenerationOfCompilationErrorMessageInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs index 65bca83..14eefa0 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/InteropTests.cs @@ -15,31 +15,6 @@ public class InteropTests : InteropTestsBase #region Embedding of objects - #region Delegates - - [Test] - public void EmbeddedInstanceOfDelegateHasFunctionPrototype() - { - // Arrange - var someFunc = new Func(() => 42); - - const string input = "Object.getPrototypeOf(embeddedFunc) === Function.prototype"; - - // Act - bool output; - - using (var jsEngine = CreateJsEngine()) - { - jsEngine.EmbedHostObject("embeddedFunc", someFunc); - output = jsEngine.Evaluate(input); - } - - // Assert - Assert.True(output); - } - - #endregion - #region Recursive calls #region Mapping of errors diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index b087cc1..07c196f 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -5,6 +5,7 @@ 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library + latest true true false @@ -14,9 +15,15 @@ + + + + + - + + \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs index 2c34764..9983e4a 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/CommonTests.cs @@ -65,7 +65,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -186,7 +186,7 @@ public virtual void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -304,7 +304,7 @@ public void GenerationOfCompilationErrorMessageInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs index 3d06904..15ee2c5 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/InteropTests.cs @@ -15,31 +15,6 @@ public class InteropTests : InteropTestsBase #region Embedding of objects - #region Delegates - - [Test] - public void EmbeddedInstanceOfDelegateHasFunctionPrototype() - { - // Arrange - var someFunc = new Func(() => 42); - - const string input = "Object.getPrototypeOf(embeddedFunc) === Function.prototype"; - - // Act - bool output; - - using (var jsEngine = CreateJsEngine()) - { - jsEngine.EmbedHostObject("embeddedFunc", someFunc); - output = jsEngine.Evaluate(input); - } - - // Assert - Assert.True(output); - } - - #endregion - #region Recursive calls #region Mapping of errors diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index a6090e4..d849933 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -5,6 +5,7 @@ 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library + latest true true false @@ -14,9 +15,15 @@ + + + + + - + + \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs b/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs index 43b314c..45a5ac3 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs +++ b/test/MsieJavaScriptEngine.Test.Classic/CommonTests.cs @@ -65,7 +65,7 @@ public void MappingCompilationErrorDuringEvaluationOfExpressionInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -186,7 +186,7 @@ public void MappingCompilationErrorDuringExecutionOfCodeInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { @@ -300,7 +300,7 @@ public void GenerationOfCompilationErrorMessageInDebugMode() JsCompilationException exception = null; // Act - using (var jsEngine = CreateJsEngine(true)) + using (var jsEngine = CreateJsEngine(enableDebugging: true)) { try { diff --git a/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs b/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs index 41d91a0..48763b5 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs +++ b/test/MsieJavaScriptEngine.Test.Classic/InteropTests.cs @@ -4,6 +4,8 @@ using NUnit.Framework; using MsieJavaScriptEngine.Test.Common; +using MsieJavaScriptEngine.Test.Common.Interop; +using MsieJavaScriptEngine.Test.Common.Interop.Animals; namespace MsieJavaScriptEngine.Test.Classic { @@ -15,6 +17,85 @@ public class InteropTests : InteropTestsBase #region Embedding of objects + #region Objects with methods + + [Test] + public override void EmbeddingOfInstanceOfCustomValueTypeAndCallingOfItsGetTypeMethod() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + var date = new Date(); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostObject("date", date); + return jsEngine.Evaluate("date.GetType();"); + } + } + + // Act and Assert + Assert.AreEqual(typeof(Date).FullName, TestAllowReflectionSetting(true)); + + var exception = Assert.Throws(() => TestAllowReflectionSetting(false)); + Assert.AreEqual("Runtime error", exception.Category); + Assert.AreEqual("Object doesn't support this property or method", exception.Description); + } + + [Test] + public override void EmbeddingOfInstanceOfCustomReferenceTypeAndCallingOfItsGetTypeMethod() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + var cat = new Cat(); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostObject("cat", cat); + return jsEngine.Evaluate("cat.GetType();"); + } + } + + // Act and Assert + Assert.AreEqual(typeof(Cat).FullName, TestAllowReflectionSetting(true)); + + var exception = Assert.Throws(() => TestAllowReflectionSetting(false)); + Assert.AreEqual("Runtime error", exception.Category); + Assert.AreEqual("Object doesn't support this property or method", exception.Description); + } + + #endregion + + #region Delegates + + [Test] + public override void EmbeddingOfInstanceOfDelegateAndCheckingItsPrototype() + { } + + [Test] + public override void EmbeddingOfInstanceOfDelegateAndGettingItsMethodProperty() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + var cat = new Cat(); + var cryFunc = new Func(cat.Cry); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostObject("cry", cryFunc); + return jsEngine.Evaluate("cry.Method;"); + } + } + + // Act and Assert + Assert.AreEqual("System.String Cry()", TestAllowReflectionSetting(true)); + Assert.AreEqual("undefined", TestAllowReflectionSetting(false)); + } + + #endregion + #region Recursive calls #region Mapping of errors @@ -67,5 +148,37 @@ public void MappingRuntimeErrorDuringRecursiveEvaluationOfFiles() #endregion #endregion + + + #region Embedding of types + + #region Creating of instances + + [Test] + public override void CreatingAnInstanceOfEmbeddedCustomExceptionAndCallingOfItsGetTypeMethod() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + Type loginFailedExceptionType = typeof(LoginFailedException); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostType("LoginFailedError", loginFailedExceptionType); + return jsEngine.Evaluate("new LoginFailedError(\"Wrong password entered!\").GetType();"); + } + } + + // Act and Assert + Assert.AreEqual(typeof(LoginFailedException).FullName, TestAllowReflectionSetting(true)); + + var exception = Assert.Throws(() => TestAllowReflectionSetting(false)); + Assert.AreEqual("Runtime error", exception.Category); + Assert.AreEqual("Object doesn't support this property or method", exception.Description); + } + + #endregion + + #endregion } } \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index beaee3e..d8d21a3 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -5,6 +5,7 @@ 3.1.0 net40;net45 Library + latest true true false diff --git a/test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs b/test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs new file mode 100644 index 0000000..72e6b20 --- /dev/null +++ b/test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs @@ -0,0 +1,50 @@ +using System; +using System.Runtime.Serialization; + +namespace MsieJavaScriptEngine.Test.Common.Interop +{ + [Serializable] + public class LoginFailedException : Exception + { + private string _userName; + + public string UserName + { + get { return _userName; } + set { _userName = value; } + } + + + public LoginFailedException() + { } + + public LoginFailedException(string message) + : base(message) + { } + + public LoginFailedException(string message, Exception innerException) + : base(message, innerException) + { } + + protected LoginFailedException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + if (info != null) + { + _userName = info.GetString("UserName"); + } + } + + + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + if (info == null) + { + throw new ArgumentNullException(nameof(info)); + } + + base.GetObjectData(info, context); + info.AddValue("UserName", this._userName); + } + } +} \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs index 9bd2684..53274a2 100644 --- a/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs @@ -432,7 +432,7 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithMethod() } [Test] - public virtual void CallingOfMethodOfCustomReferenceTypeWithInterfaceParameter() + public virtual void EmbeddingOfInstancesOfCustomReferenceTypesAndCallingOfMethodOfWithInterfaceParameter() { // Arrange var animalTrainer = new AnimalTrainer(); @@ -463,6 +463,52 @@ public virtual void CallingOfMethodOfCustomReferenceTypeWithInterfaceParameter() Assert.AreEqual(targetOutput2, output2); } + [Test] + public virtual void EmbeddingOfInstanceOfCustomValueTypeAndCallingOfItsGetTypeMethod() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + var date = new Date(); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostObject("date", date); + return jsEngine.Evaluate("date.GetType();"); + } + } + + // Act and Assert + Assert.AreEqual(typeof(Date).FullName, TestAllowReflectionSetting(true)); + + var exception = Assert.Throws(() => TestAllowReflectionSetting(false)); + Assert.AreEqual("Runtime error", exception.Category); + Assert.AreEqual("Object doesn't support property or method 'GetType'", exception.Description); + } + + [Test] + public virtual void EmbeddingOfInstanceOfCustomReferenceTypeAndCallingOfItsGetTypeMethod() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + var cat = new Cat(); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostObject("cat", cat); + return jsEngine.Evaluate("cat.GetType();"); + } + } + + // Act and Assert + Assert.AreEqual(typeof(Cat).FullName, TestAllowReflectionSetting(true)); + + var exception = Assert.Throws(() => TestAllowReflectionSetting(false)); + Assert.AreEqual("Runtime error", exception.Category); + Assert.AreEqual("Object doesn't support property or method 'GetType'", exception.Description); + } + #endregion #region Delegates @@ -597,7 +643,28 @@ public virtual void EmbeddingOfInstanceOfDelegateWithoutResult() } [Test] - public virtual void CallingOfEmbeddedDelegateWithMissingParameter() + public virtual void EmbeddingOfInstanceOfDelegateAndCheckingItsPrototype() + { + // Arrange + var someFunc = new Func(() => 42); + + const string input = "Object.getPrototypeOf(embeddedFunc) === Function.prototype"; + + // Act + bool output; + + using (var jsEngine = CreateJsEngine()) + { + jsEngine.EmbedHostObject("embeddedFunc", someFunc); + output = jsEngine.Evaluate(input); + } + + // Assert + Assert.True(output); + } + + [Test] + public virtual void EmbeddingOfInstanceOfDelegateAndCallingItWithMissingParameter() { // Arrange var sumFunc = new Func((a, b) => a + b); @@ -625,7 +692,7 @@ public virtual void CallingOfEmbeddedDelegateWithMissingParameter() } [Test] - public virtual void CallingOfEmbeddedDelegateWithExtraParameter() + public virtual void EmbeddingOfInstanceOfDelegateAndCallingItWithExtraParameter() { // Arrange var sumFunc = new Func((a, b) => a + b); @@ -646,6 +713,27 @@ public virtual void CallingOfEmbeddedDelegateWithExtraParameter() Assert.AreEqual(targetOutput, output); } + [Test] + public virtual void EmbeddingOfInstanceOfDelegateAndGettingItsMethodProperty() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + var cat = new Cat(); + var cryFunc = new Func(cat.Cry); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostObject("cry", cryFunc); + return jsEngine.Evaluate("cry.Method;"); + } + } + + // Act and Assert + Assert.AreEqual("undefined", TestAllowReflectionSetting(true)); + Assert.AreEqual("undefined", TestAllowReflectionSetting(false)); + } + #endregion #region Integration @@ -888,6 +976,49 @@ public virtual void CreatingAnInstanceOfEmbeddedCustomReferenceType() Assert.AreEqual(targetOutput, output); } + [Test] + public virtual void CreatingAnInstanceOfEmbeddedBuiltinExceptionAndGettingItsTargetSiteProperty() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + Type invalidOperationExceptionType = typeof(InvalidOperationException); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostType("InvalidOperationError", invalidOperationExceptionType); + return jsEngine.Evaluate("new InvalidOperationError(\"A terrible thing happened!\").TargetSite;"); + } + } + + // Act and Assert + Assert.AreEqual(null, TestAllowReflectionSetting(true)); + Assert.AreEqual("undefined", TestAllowReflectionSetting(false)); + } + + [Test] + public virtual void CreatingAnInstanceOfEmbeddedCustomExceptionAndCallingOfItsGetTypeMethod() + { + // Arrange + string TestAllowReflectionSetting(bool allowReflection) + { + Type loginFailedExceptionType = typeof(LoginFailedException); + + using (var jsEngine = CreateJsEngine(allowReflection: allowReflection)) + { + jsEngine.EmbedHostType("LoginFailedError", loginFailedExceptionType); + return jsEngine.Evaluate("new LoginFailedError(\"Wrong password entered!\").GetType();"); + } + } + + // Act and Assert + Assert.AreEqual(typeof(LoginFailedException).FullName, TestAllowReflectionSetting(true)); + + var exception = Assert.Throws(() => TestAllowReflectionSetting(false)); + Assert.AreEqual("Runtime error", exception.Category); + Assert.AreEqual("Object doesn't support property or method 'GetType'", exception.Description); + } + #endregion #region Types with constants diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 1398b23..c32328a 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -5,6 +5,7 @@ 3.1.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library + latest true true false @@ -15,12 +16,19 @@ - + + + + + + + + diff --git a/test/MsieJavaScriptEngine.Test.Common/TestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/TestsBase.cs index 81c99f7..6854dfb 100644 --- a/test/MsieJavaScriptEngine.Test.Common/TestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/TestsBase.cs @@ -18,15 +18,11 @@ public abstract class TestsBase protected virtual bool UseJson2Library => false; - protected MsieJsEngine CreateJsEngine() - { - return CreateJsEngine(false); - } - - protected MsieJsEngine CreateJsEngine(bool enableDebugging) + protected MsieJsEngine CreateJsEngine(bool allowReflection = false, bool enableDebugging = false) { var jsEngine = new MsieJsEngine(new JsEngineSettings { + AllowReflection = allowReflection, EnableDebugging = enableDebugging, EngineMode = EngineMode, UseEcmaScript5Polyfill = UseEcmaScript5Polyfill, From 4856631f01ab84091ccbabc33d14734812129324 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Sun, 26 Feb 2023 20:12:21 +0300 Subject: [PATCH 14/28] Version 3.2.0 --- CHANGELOG.md | 3 ++ Licenses/bundler-and-minifier-license.txt | 13 --------- Licenses/uglify-js-license.txt | 29 +++++++++++++++++++ README.md | 11 ++++++- .../MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/package.json | 2 +- src/MsieJavaScriptEngine/readme.txt | 4 +-- .../MsieJavaScriptEngine.Benchmarks.csproj | 2 +- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- ...criptEngine.Test.ChakraActiveScript.csproj | 2 +- ...avaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- ...eJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 2 +- 14 files changed, 53 insertions(+), 25 deletions(-) delete mode 100644 Licenses/bundler-and-minifier-license.txt create mode 100644 Licenses/uglify-js-license.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c11bf7..1c3d8da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Change log ========== +## v3.2.0 - February 26, 2023 + * In JavaScript engine settings was added one new property - `AllowReflection` (default `false`) + ## v3.1.0 - February 6, 2023 * In JsRT modes, `JsVariantToValue` and `JsValueToVariant` native methods are no longer used for embedding objects and types * JSON2 library was updated to version of October 30, 2022 diff --git a/Licenses/bundler-and-minifier-license.txt b/Licenses/bundler-and-minifier-license.txt deleted file mode 100644 index 3115a6d..0000000 --- a/Licenses/bundler-and-minifier-license.txt +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2015-2020 Mads Kristensen - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file diff --git a/Licenses/uglify-js-license.txt b/Licenses/uglify-js-license.txt new file mode 100644 index 0000000..87a0854 --- /dev/null +++ b/Licenses/uglify-js-license.txt @@ -0,0 +1,29 @@ +UglifyJS is released under the BSD license: + +Copyright 2012-2019 (c) Mihai Bazon + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index c152ac5..ddbfcdc 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,15 @@ Consider in detail properties of the + AllowReflection + Boolean + false + +

Flag for whether to allow the usage of reflection API in the script code.

+

This affects Object.GetType, Exception.GetType, Exception.TargetSite and Delegate.Method.

+ + EnableDebugging Boolean @@ -153,7 +162,7 @@ See the [changelog](CHANGELOG.md). * [ECMAScript 5 Polyfill](https://www.nuget.org/packages/ES5) and [MDN JavaScript Polyfills](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference) - Adds support for many of the new functions in ECMAScript 5 to downlevel browsers. * [Cross-Browser Split](https://blog.stevenlevithan.com/archives/cross-browser-split) - Adds ECMAScript compliant and uniform cross-browser split method. * [JSON2 library](https://github.com/douglascrockford/JSON-js) - Adds support of the JSON object from ECMAScript 5 to downlevel browsers. - * [Bundler and Minifier](https://github.com/madskristensen/BundlerMinifier) - [License: Apache License 2.0 (Apache)](http://github.com/madskristensen/BundlerMinifier/blob/master/LICENSE) JS-files, that used MSIE JS Engine, minificated by using this tool. + * [UglifyJS](https://github.com/mishoo/UglifyJS) - [License: BSD License (BSD)](https://github.com/mishoo/UglifyJS/blob/master/LICENSE) JS-files, that used MSIE JS Engine, minificated by using this tool. ## Who's Using MSIE JavaScript Engine If you use the MSIE JavaScript Engine in some project, please send me a message so I can include it in this list: diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 72acc70..68a40e4 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine for .NET - 3.1.0 + 3.2.0 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 7.3 diff --git a/src/MsieJavaScriptEngine/package.json b/src/MsieJavaScriptEngine/package.json index 381dbb5..3810707 100644 --- a/src/MsieJavaScriptEngine/package.json +++ b/src/MsieJavaScriptEngine/package.json @@ -1,6 +1,6 @@ { "name": "MsieJavaScriptEngine", - "version": "3.1.0", + "version": "3.2.0", "devDependencies": { "uglify-js": "3.16.1" }, diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 319849c..b22abec 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,7 +1,7 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.1.0 + README file for MSIE JavaScript Engine for .NET v3.2.0 -------------------------------------------------------------------------------- @@ -27,4 +27,4 @@ ============ PROJECT SITE ============ - http://github.com/Taritsyn/MsieJavaScriptEngine \ No newline at end of file + https://github.com/Taritsyn/MsieJavaScriptEngine \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index 674cebb..cdc78e3 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Benchmarks - 3.1.0 + 3.2.0 net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Exe true diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 7748d17..a3b6049 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.1.0 + 3.2.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index 3ba8b43..f7765fc 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.1.0 + 3.2.0 net40;net45 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 07c196f..142818d 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.1.0 + 3.2.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index d849933..ce18c31 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.1.0 + 3.2.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index d8d21a3..61e1770 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.1.0 + 3.2.0 net40;net45 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index c32328a..b1ea524 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Common Tests - 3.1.0 + 3.2.0 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest From 96ab036cf21c7ee1343770ee1142b92c40f95604 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 27 Feb 2023 20:02:08 +0300 Subject: [PATCH 15/28] In JsRT modes improved a performance of .NET methods projection --- .../JsRt/Edge/EdgeTypeMapper.cs | 6 ++-- .../JsRt/Ie/IeTypeMapper.cs | 6 ++-- src/MsieJavaScriptEngine/JsRt/TypeMapper.cs | 33 ++++++++++++++++--- .../MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/readme.txt | 3 +- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs index eabfe7a..4cae2b4 100644 --- a/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Edge/EdgeTypeMapper.cs @@ -573,12 +573,12 @@ private void ProjectMethods(EdgeEmbeddedItem externalItem) string typeName = type.FullName; BindingFlags defaultBindingFlags = ReflectionHelpers.GetDefaultBindingFlags(instance); MethodInfo[] methods = type.GetMethods(defaultBindingFlags); - IEnumerable> availableMethodGroups = GetAvailableMethodGroups(methods); + Dictionary> availableMethodGroups = GetAvailableMethodGroups(methods); - foreach (IGrouping methodGroup in availableMethodGroups) + foreach (KeyValuePair> methodGroup in availableMethodGroups) { string methodName = methodGroup.Key; - MethodInfo[] methodCandidates = methodGroup.ToArray(); + MethodInfo[] methodCandidates = methodGroup.Value.ToArray(); EdgeJsNativeFunction nativeFunction = (callee, isConstructCall, args, argCount, callbackData) => { diff --git a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs index a3e4944..004c7e9 100644 --- a/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/Ie/IeTypeMapper.cs @@ -573,12 +573,12 @@ private void ProjectMethods(IeEmbeddedItem externalItem) string typeName = type.FullName; BindingFlags defaultBindingFlags = ReflectionHelpers.GetDefaultBindingFlags(instance); MethodInfo[] methods = type.GetMethods(defaultBindingFlags); - IEnumerable> availableMethodGroups = GetAvailableMethodGroups(methods); + Dictionary> availableMethodGroups = GetAvailableMethodGroups(methods); - foreach (IGrouping methodGroup in availableMethodGroups) + foreach (KeyValuePair> methodGroup in availableMethodGroups) { string methodName = methodGroup.Key; - MethodInfo[] methodCandidates = methodGroup.ToArray(); + MethodInfo[] methodCandidates = methodGroup.Value.ToArray(); IeJsNativeFunction nativeFunction = (callee, isConstructCall, args, argCount, callbackData) => { diff --git a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs index 8615e09..de3fd5a 100644 --- a/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs +++ b/src/MsieJavaScriptEngine/JsRt/TypeMapper.cs @@ -229,14 +229,37 @@ protected bool IsAvailableProperty(PropertyInfo property) return isAvailable; } - protected IEnumerable> GetAvailableMethodGroups(MethodInfo[] methods) + protected Dictionary> GetAvailableMethodGroups(MethodInfo[] methods) { - IEnumerable availableMethods = methods.Where(ReflectionHelpers.IsFullyFledgedMethod); - if (!_allowReflection) + int methodCount = methods.Length; + if (methodCount == 0) { - availableMethods = availableMethods.Where(ReflectionHelpers.IsAllowedMethod); + return new Dictionary>(); + } + + var availableMethodGroups = new Dictionary>(methodCount); + + foreach (MethodInfo method in methods) + { + if (!ReflectionHelpers.IsFullyFledgedMethod(method) + || (!_allowReflection && !ReflectionHelpers.IsAllowedMethod(method))) + { + continue; + } + + string methodName = method.Name; + List methodGroup; + + if (availableMethodGroups.TryGetValue(methodName, out methodGroup)) + { + methodGroup.Add(method); + } + else + { + methodGroup = new List { method }; + availableMethodGroups.Add(methodName, methodGroup); + } } - IEnumerable> availableMethodGroups = availableMethods.GroupBy(m => m.Name); return availableMethodGroups; } diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 68a40e4..7a37a41 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - In JavaScript engine settings was added one new property - `AllowReflection` (default `false`). + In JsRT modes improved a performance of .NET methods projection. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index b22abec..4d4626a 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,8 +21,7 @@ ============= RELEASE NOTES ============= - In JavaScript engine settings was added one new property - `AllowReflection` - (default `false`). + In JsRT modes improved a performance of .NET methods projection. ============ PROJECT SITE From 957737bc9e4b02d92757135e353fdea947ec6d5a Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 27 Feb 2023 20:43:30 +0300 Subject: [PATCH 16/28] Version 3.2.1 --- CHANGELOG.md | 3 +++ src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/package.json | 2 +- src/MsieJavaScriptEngine/readme.txt | 2 +- .../MsieJavaScriptEngine.Benchmarks.csproj | 2 +- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraActiveScript.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 2 +- 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c3d8da..a0532e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Change log ========== +## v3.2.1 - February 27, 2023 + * In JsRT modes improved a performance of .NET methods projection + ## v3.2.0 - February 26, 2023 * In JavaScript engine settings was added one new property - `AllowReflection` (default `false`) diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 7a37a41..b876aa4 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine for .NET - 3.2.0 + 3.2.1 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 7.3 diff --git a/src/MsieJavaScriptEngine/package.json b/src/MsieJavaScriptEngine/package.json index 3810707..b7509ba 100644 --- a/src/MsieJavaScriptEngine/package.json +++ b/src/MsieJavaScriptEngine/package.json @@ -1,6 +1,6 @@ { "name": "MsieJavaScriptEngine", - "version": "3.2.0", + "version": "3.2.1", "devDependencies": { "uglify-js": "3.16.1" }, diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 4d4626a..33694cc 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,7 +1,7 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.2.0 + README file for MSIE JavaScript Engine for .NET v3.2.1 -------------------------------------------------------------------------------- diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index cdc78e3..cda4be2 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Benchmarks - 3.2.0 + 3.2.1 net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Exe true diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index a3b6049..0f3a008 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.2.0 + 3.2.1 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index f7765fc..5ac0f22 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.2.0 + 3.2.1 net40;net45 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 142818d..29d9f82 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.2.0 + 3.2.1 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index ce18c31..dbe005c 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.2.0 + 3.2.1 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index 61e1770..2644a7c 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.2.0 + 3.2.1 net40;net45 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index b1ea524..cc5ff94 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Common Tests - 3.2.0 + 3.2.1 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest From 3dad6404a9e62fb7421311c5645997e151a994c7 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Sun, 9 Apr 2023 20:33:10 +0300 Subject: [PATCH 17/28] Fixed a error due to which the global object to become read-only after embedding of the host objects and types --- .../ActiveScript/ActiveScriptJsEngineBase.cs | 2 +- .../MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/readme.txt | 3 +- .../Interop/SomeClass.cs | 10 +++ .../InteropTestsBase.cs | 70 +++++++++++++++++++ 5 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 test/MsieJavaScriptEngine.Test.Common/Interop/SomeClass.cs diff --git a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs index eeabc4e..57bca46 100644 --- a/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs +++ b/src/MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs @@ -535,7 +535,7 @@ private void InnerEmbedHostItem(string itemName, object value) try { - _activeScriptWrapper.AddNamedItem(itemName, ScriptItemFlags.IsVisible | ScriptItemFlags.GlobalMembers); + _activeScriptWrapper.AddNamedItem(itemName, ScriptItemFlags.IsVisible); } catch { diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index b876aa4..cecd1c4 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - In JsRT modes improved a performance of .NET methods projection. + Fixed a error due to which the global object to become read-only after embedding of the host objects and types. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 33694cc..e6e2cd8 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,7 +21,8 @@ ============= RELEASE NOTES ============= - In JsRT modes improved a performance of .NET methods projection. + Fixed a error due to which the global object to become read-only after embedding + of the host objects and types. ============ PROJECT SITE diff --git a/test/MsieJavaScriptEngine.Test.Common/Interop/SomeClass.cs b/test/MsieJavaScriptEngine.Test.Common/Interop/SomeClass.cs new file mode 100644 index 0000000..8a85635 --- /dev/null +++ b/test/MsieJavaScriptEngine.Test.Common/Interop/SomeClass.cs @@ -0,0 +1,10 @@ +namespace MsieJavaScriptEngine.Test.Common.Interop +{ + public class SomeClass + { + public int SomeProperty { get; set; } = 123; + public string SomeOtherProperty { get; set; } = "abc"; + + public static SomeClass Instance { get; } = new SomeClass(); + } +} \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs index 53274a2..8cbb90a 100644 --- a/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/InteropTestsBase.cs @@ -877,6 +877,41 @@ public virtual void RemovingOfEmbeddedInstanceOfCustomReferenceType() #endregion + #region Special cases + + [Test] + public virtual void EmbeddingOfInstanceOfCustomReferenceTypeAndModificationOfGlobalObject() + { + // Arrange + var someObj = new SomeClass(); + + const string modifyingCode = @"(function () { + 'use strict'; + + var global = typeof self != 'undefined' && self.Math == Math ? + self : Function('return this')(); + + global['foo'] = 'bar'; +})();"; + const string variableName = "foo"; + const string targetOutput = "bar"; + + // Act + string output; + + using (var jsEngine = CreateJsEngine()) + { + jsEngine.EmbedHostObject("someObj", someObj); + jsEngine.Execute(modifyingCode); + output = jsEngine.GetVariableValue(variableName); + } + + // Assert + Assert.AreEqual(targetOutput, output); + } + + #endregion + #endregion @@ -1443,6 +1478,41 @@ public virtual void RemovingOfEmbeddedCustomReferenceType() #endregion + #region Special cases + + [Test] + public virtual void EmbeddingOfCustomReferenceTypeAndModificationOfGlobalObject() + { + // Arrange + var someType = typeof(SomeClass); + + const string modifyingCode = @"(function () { + 'use strict'; + + var global = typeof self != 'undefined' && self.Math == Math ? + self : Function('return this')(); + + global.foo = 'baz'; +})();"; + const string variableName = "foo"; + const string targetOutput = "baz"; + + // Act + string output; + + using (var jsEngine = CreateJsEngine()) + { + jsEngine.EmbedHostType("SomeType", someType); + jsEngine.Execute(modifyingCode); + output = jsEngine.GetVariableValue(variableName); + } + + // Assert + Assert.AreEqual(targetOutput, output); + } + + #endregion + #endregion } } \ No newline at end of file From 7f7332cc4a8b33d68a3e16e119871a69b108b460 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 10 Apr 2023 15:47:05 +0300 Subject: [PATCH 18/28] Version 3.2.2 --- CHANGELOG.md | 3 +++ global.json | 2 +- src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 4 ++-- src/MsieJavaScriptEngine/readme.txt | 4 ++-- .../MsieJavaScriptEngine.Benchmarks.csproj | 2 +- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraActiveScript.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 2 +- 11 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0532e8..7773510 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Change log ========== +## v3.2.2 - April 10, 2023 + * Fixed a error due to which the global object to become read-only after embedding of the host objects and types. Special thanks to [Denis Pushkarev](https://github.com/zloirock). + ## v3.2.1 - February 27, 2023 * In JsRT modes improved a performance of .NET methods projection diff --git a/global.json b/global.json index 4347eeb..8344741 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.200" + "version": "7.0.202" } } diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index cecd1c4..ad652ec 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine for .NET - 3.2.1 + 3.2.2 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 7.3 @@ -25,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - Fixed a error due to which the global object to become read-only after embedding of the host objects and types. + Fixed a error due to which the global object to become read-only after embedding of the host objects and types. Special thanks to Denis Pushkarev. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index e6e2cd8..8e0235c 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,7 +1,7 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.2.1 + README file for MSIE JavaScript Engine for .NET v3.2.2 -------------------------------------------------------------------------------- @@ -22,7 +22,7 @@ RELEASE NOTES ============= Fixed a error due to which the global object to become read-only after embedding - of the host objects and types. + of the host objects and types. Special thanks to Denis Pushkarev. ============ PROJECT SITE diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index cda4be2..68810ee 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Benchmarks - 3.2.1 + 3.2.2 net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Exe true diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 0f3a008..6725fcf 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.2.1 + 3.2.2 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index 5ac0f22..1e6b845 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.2.1 + 3.2.2 net40;net45 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 29d9f82..205cbe6 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.2.1 + 3.2.2 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index dbe005c..0ccf555 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.2.1 + 3.2.2 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index 2644a7c..e95caaa 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.2.1 + 3.2.2 net40;net45 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index cc5ff94..6cade8f 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Common Tests - 3.2.1 + 3.2.2 net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 Library latest From ab17463dc27702bdd02bf7b50b54c6bd5612d7bc Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Tue, 18 Apr 2023 12:39:37 +0300 Subject: [PATCH 19/28] Changed a `SupportsFunctionBindMethod` test --- global.json | 2 +- .../Es5TestsBase.cs | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/global.json b/global.json index 8344741..ad7cdc7 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.202" + "version": "7.0.203" } } diff --git a/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs index ca95a34..762cf9a 100644 --- a/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs @@ -393,18 +393,25 @@ public virtual void SupportsDateToIsoStringMethod() public virtual void SupportsFunctionBindMethod() { // Arrange - const string initCode = @"var a = 5, - module = { - a: 12, - getA: function() { return this.a; } - }, - getA = module.getA + const string initCode = @"var A = (function () { + function A(a) { + this.a = a; + } + + A.prototype.getA = function() { + return this.a; + }; + + return A; + })(), + a = new A(5), + otherContext = { a: 12 } ;"; - const string input1 = "getA();"; + const string input1 = "a.getA();"; const int targetOutput1 = 5; - const string input2 = "getA.bind(module)();"; + const string input2 = "a.getA.bind(otherContext)();"; const int targetOutput2 = 12; // Act From 0e59be14e67afc2ba13b3d3804acb03dcea6cccd Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Fri, 1 Dec 2023 20:49:17 +0300 Subject: [PATCH 20/28] In test projects added support of .NET 8 --- global.json | 2 +- .../MsieJavaScriptEngine.csproj | 2 +- .../Resources/CommonStrings.Designer.cs | 2 +- .../Resources/NetCoreStrings.Designer.cs | 2 +- .../Resources/NetFrameworkStrings.Designer.cs | 2 +- .../HostObjectsEmbeddingBenchmark.cs | 6 ++++- .../HostTypesEmbeddingBenchmark.cs | 6 ++++- .../JsExecutionBenchmark.cs | 2 +- .../MsieJavaScriptEngine.Benchmarks.csproj | 13 +++------- .../MsieJavaScriptEngine.Test.Auto.csproj | 13 +++------- ...criptEngine.Test.ChakraActiveScript.csproj | 4 +-- ...avaScriptEngine.Test.ChakraEdgeJsRt.csproj | 13 +++------- ...eJavaScriptEngine.Test.ChakraIeJsRt.csproj | 13 +++------- .../MsieJavaScriptEngine.Test.Classic.csproj | 4 +-- .../CommonTestsBase.cs | 4 --- .../Interop/LoginFailedException.cs | 4 +++ .../MsieJavaScriptEngine.Test.Common.csproj | 25 ++++--------------- .../PrecompilationTestsBase.cs | 4 --- 18 files changed, 41 insertions(+), 80 deletions(-) diff --git a/global.json b/global.json index ad7cdc7..5ce8495 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.203" + "version": "8.0.100" } } diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index ad652ec..c83aa82 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -40,7 +40,7 @@ - + diff --git a/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs b/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs index 1154f28..07f2d33 100644 --- a/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs +++ b/src/MsieJavaScriptEngine/Resources/CommonStrings.Designer.cs @@ -21,7 +21,7 @@ internal class CommonStrings private static Lazy _resourceManager = new Lazy(() => new ResourceManager( "MsieJavaScriptEngine.Resources.CommonStrings", -#if NET40 +#if NET20 || NET30 || NET35 || NET40 typeof(CommonStrings).Assembly #else typeof(CommonStrings).GetTypeInfo().Assembly diff --git a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs index a115222..21c4dc4 100644 --- a/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs +++ b/src/MsieJavaScriptEngine/Resources/NetCoreStrings.Designer.cs @@ -21,7 +21,7 @@ internal class NetCoreStrings private static Lazy _resourceManager = new Lazy(() => new ResourceManager( "MsieJavaScriptEngine.Resources.NetCoreStrings", -#if NET40 +#if NET20 || NET30 || NET35 || NET40 typeof(NetCoreStrings).Assembly #else typeof(NetCoreStrings).GetTypeInfo().Assembly diff --git a/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.Designer.cs b/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.Designer.cs index feea37f..b5404bc 100644 --- a/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.Designer.cs +++ b/src/MsieJavaScriptEngine/Resources/NetFrameworkStrings.Designer.cs @@ -21,7 +21,7 @@ internal class NetFrameworkStrings private static Lazy _resourceManager = new Lazy(() => new ResourceManager( "MsieJavaScriptEngine.Resources.NetFrameworkStrings", -#if NET40 +#if NET20 || NET30 || NET35 || NET40 typeof(NetFrameworkStrings).Assembly #else typeof(NetFrameworkStrings).GetTypeInfo().Assembly diff --git a/test/MsieJavaScriptEngine.Benchmarks/HostObjectsEmbeddingBenchmark.cs b/test/MsieJavaScriptEngine.Benchmarks/HostObjectsEmbeddingBenchmark.cs index b0a91df..700a6bf 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/HostObjectsEmbeddingBenchmark.cs +++ b/test/MsieJavaScriptEngine.Benchmarks/HostObjectsEmbeddingBenchmark.cs @@ -66,7 +66,11 @@ private static void EmbedAndUseHostObjects(Func createJsEngine) return result; }(someObj, log));"; +#if NET462 const string targetOutput = "RmFsc2V8MjkxNHwwLjg3Mjg1OTEwNzM4ODQyNHxBU0RG0KTQq9CS0JA="; +#else + const string targetOutput = "RmFsc2V8MjkxNHwwLjg3Mjg1OTEwNzM4ODQyMzV8QVNERtCk0KvQktCQ"; +#endif string targetLogOutput = "-= Start code execution =-" + Environment.NewLine + "-= End of code execution =-" + Environment.NewLine; @@ -89,7 +93,7 @@ private static void EmbedAndUseHostObjects(Func createJsEngine) Assert.Equal(targetOutput, output); Assert.Equal(targetLogOutput, logOutput); } -#if NET461 +#if NET462 [Benchmark] public void Classic() diff --git a/test/MsieJavaScriptEngine.Benchmarks/HostTypesEmbeddingBenchmark.cs b/test/MsieJavaScriptEngine.Benchmarks/HostTypesEmbeddingBenchmark.cs index a53ba9a..4bd965c 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/HostTypesEmbeddingBenchmark.cs +++ b/test/MsieJavaScriptEngine.Benchmarks/HostTypesEmbeddingBenchmark.cs @@ -52,7 +52,11 @@ private static void EmbedAndUseHostTypes(Func createJsEngine) return result; }(SomeClass, Point, SomeOtherClass));"; +#if NET462 const string targetOutput = "RmFsc2V8MjkyMHwwLjg3Mjg1OTEwNzM4ODQyNHxBU0RG0KTQq9CS0JA="; +#else + const string targetOutput = "RmFsc2V8MjkyMHwwLjg3Mjg1OTEwNzM4ODQyMzV8QVNERtCk0KvQktCQ"; +#endif // Act string output; @@ -69,7 +73,7 @@ private static void EmbedAndUseHostTypes(Func createJsEngine) // Assert Assert.Equal(targetOutput, output); } -#if NET461 +#if NET462 [Benchmark] public void Classic() diff --git a/test/MsieJavaScriptEngine.Benchmarks/JsExecutionBenchmark.cs b/test/MsieJavaScriptEngine.Benchmarks/JsExecutionBenchmark.cs index 75f135f..633680b 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/JsExecutionBenchmark.cs +++ b/test/MsieJavaScriptEngine.Benchmarks/JsExecutionBenchmark.cs @@ -182,7 +182,7 @@ private static void TransliterateStrings(Func createJsEngine, bool Assert.Equal(_targetOutputStrings[itemIndex], outputStrings[itemIndex]); } } -#if NET461 +#if NET462 [Benchmark] public void Classic() diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index 68810ee..4f032d7 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -3,25 +3,18 @@ MSIE JavaScript Engine: Benchmarks 3.2.2 - net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Exe true false - false - - + - - - - - - + diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 6725fcf..e9c7354 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -3,27 +3,20 @@ MSIE JavaScript Engine: Tests for Auto Mode 3.2.2 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest true true false - false - - + - - - - - - + \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index 1e6b845..f5b51c7 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode 3.2.2 - net40;net45 + net462 Library latest true @@ -14,7 +14,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 205cbe6..e6780c2 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -3,27 +3,20 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode 3.2.2 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest true true false - false - - + - - - - - - + \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index 0ccf555..60cf7c7 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -3,27 +3,20 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode 3.2.2 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest true true false - false - - + - - - - - - + \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index e95caaa..c926391 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -3,7 +3,7 @@ MSIE JavaScript Engine: Tests for Classic Mode 3.2.2 - net40;net45 + net462 Library latest true @@ -14,7 +14,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs index 9559651..76ee95e 100644 --- a/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/CommonTestsBase.cs @@ -1,8 +1,6 @@ using System; using System.IO; -#if !NET40 using System.Reflection; -#endif using System.Threading; using NUnit.Framework; @@ -247,9 +245,7 @@ public virtual void ExecutionOfResourceByNameAndAssembly() using (var jsEngine = CreateJsEngine()) { jsEngine.ExecuteResource(resourceName, typeof(CommonTestsBase) -#if !NET40 .GetTypeInfo() -#endif .Assembly ); output = jsEngine.Evaluate(input); diff --git a/test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs b/test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs index 72e6b20..85f1f40 100644 --- a/test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs +++ b/test/MsieJavaScriptEngine.Test.Common/Interop/LoginFailedException.cs @@ -1,5 +1,7 @@ using System; +#if !NET8_0_OR_GREATER using System.Runtime.Serialization; +#endif namespace MsieJavaScriptEngine.Test.Common.Interop { @@ -25,6 +27,7 @@ public LoginFailedException(string message) public LoginFailedException(string message, Exception innerException) : base(message, innerException) { } +#if !NET8_0_OR_GREATER protected LoginFailedException(SerializationInfo info, StreamingContext context) : base(info, context) @@ -46,5 +49,6 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont base.GetObjectData(info, context); info.AddValue("UserName", this._userName); } +#endif } } \ No newline at end of file diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 6cade8f..47521f5 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -3,41 +3,26 @@ MSIE JavaScript Engine: Common Tests 3.2.2 - net40;net45;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest true true false - false - + + + - - - - - - - - - - - - - - - - - + diff --git a/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs b/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs index b50d472..772e218 100644 --- a/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs +++ b/test/MsieJavaScriptEngine.Test.Common/PrecompilationTestsBase.cs @@ -1,7 +1,5 @@ using System.IO; -#if !NET40 using System.Reflection; -#endif using System.Threading.Tasks; using NUnit.Framework; @@ -207,9 +205,7 @@ public virtual void ExecutionOfPrecompiledResourceByNameAndAssembly() if (supportsScriptPrecompilation) { precompiledResource = jsEngine.PrecompileResource(resourceName, typeof(PrecompilationTestsBase) -#if !NET40 .GetTypeInfo() -#endif .Assembly ); From bbd521cf4afba784f2089003f04cec228e41f326 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 4 Dec 2023 20:33:12 +0300 Subject: [PATCH 21/28] JSON2 library was updated to version of May 10, 2023 --- .../MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/Resources/json2.js | 39 +------------------ src/MsieJavaScriptEngine/readme.txt | 3 +- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index c83aa82..3a5a2ed 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - Fixed a error due to which the global object to become read-only after embedding of the host objects and types. Special thanks to Denis Pushkarev. + JSON2 library was updated to version of May 10, 2023. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/Resources/json2.js b/src/MsieJavaScriptEngine/Resources/json2.js index adac444..b43526d 100644 --- a/src/MsieJavaScriptEngine/Resources/json2.js +++ b/src/MsieJavaScriptEngine/Resources/json2.js @@ -1,5 +1,5 @@ // json2.js -// 2022-10-30 +// 2023-05-10 // Public Domain. // NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. @@ -231,29 +231,6 @@ if (typeof JSON !== "object") { } -// This variable is initialized with an empty array every time -// JSON.stringify() is invoked and checked by the str() function. It's -// used to keep references to object structures and capture cyclic -// objects. Every new object is checked for its existence in this -// array. If it's found it means the JSON object is cyclic and we have -// to stop execution and throw a TypeError accordingly the ECMA262 -// (see NOTE 1 by the link https://tc39.es/ecma262/#sec-json.stringify). - - var seen; - -// Emulate [].includes(). It's actual for old-fashioned JScript. - - function includes(array, value) { - var i; - for (i = 0; i < array.length; i += 1) { - if (value === array[i]) { - return true; - } - } - return false; - } - - function str(key, holder) { // Produce a string from holder[key]. @@ -318,16 +295,6 @@ if (typeof JSON !== "object") { return "null"; } -// Check the value is not circular object. Otherwise throw TypeError. - - if (includes(seen, value)) { - throw new TypeError("Converting circular structure to JSON"); - } - -// Keep the value for the further check on circular references. - - seen.push(value); - // Make an array to hold the partial results of stringifying this object value. gap += indent; @@ -461,10 +428,6 @@ if (typeof JSON !== "object") { throw new Error("JSON.stringify"); } -// Initialize the reference keeper. - - seen = []; - // Make a fake root object containing our value under the key of "". // Return the result of stringifying the value. diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 8e0235c..dc9fe0c 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,8 +21,7 @@ ============= RELEASE NOTES ============= - Fixed a error due to which the global object to become read-only after embedding - of the host objects and types. Special thanks to Denis Pushkarev. + JSON2 library was updated to version of May 10, 2023. ============ PROJECT SITE From ed02816bb925f88ba3bfc46c6f5beb18bc9a865d Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Wed, 6 Dec 2023 19:30:50 +0300 Subject: [PATCH 22/28] Version 3.2.3 --- CHANGELOG.md | 3 +++ src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/package.json | 2 +- src/MsieJavaScriptEngine/readme.txt | 2 +- .../MsieJavaScriptEngine.Benchmarks.csproj | 4 ++-- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraActiveScript.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 2 +- 11 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7773510..78e3d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Change log ========== +## v3.2.3 - December 6, 2023 + * JSON2 library was updated to version of May 10, 2023 + ## v3.2.2 - April 10, 2023 * Fixed a error due to which the global object to become read-only after embedding of the host objects and types. Special thanks to [Denis Pushkarev](https://github.com/zloirock). diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 3a5a2ed..1ce2b1a 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine for .NET - 3.2.2 + 3.2.3 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 7.3 diff --git a/src/MsieJavaScriptEngine/package.json b/src/MsieJavaScriptEngine/package.json index b7509ba..5561b6a 100644 --- a/src/MsieJavaScriptEngine/package.json +++ b/src/MsieJavaScriptEngine/package.json @@ -1,6 +1,6 @@ { "name": "MsieJavaScriptEngine", - "version": "3.2.1", + "version": "3.2.3", "devDependencies": { "uglify-js": "3.16.1" }, diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index dc9fe0c..912fcad 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,7 +1,7 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.2.2 + README file for MSIE JavaScript Engine for .NET v3.2.3 -------------------------------------------------------------------------------- diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index 4f032d7..a84d2bb 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Benchmarks - 3.2.2 + 3.2.3 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Exe true @@ -12,7 +12,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index e9c7354..f864fa1 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.2.2 + 3.2.3 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index f5b51c7..f7a318d 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.2.2 + 3.2.3 net462 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index e6780c2..0716698 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.2.2 + 3.2.3 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index 60cf7c7..c97a986 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.2.2 + 3.2.3 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index c926391..3bfafa1 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.2.2 + 3.2.3 net462 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 47521f5..69a5920 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Common Tests - 3.2.2 + 3.2.3 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest From c9e3190dee265704160db287b02987572983f969 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 8 Jan 2024 18:08:02 +0300 Subject: [PATCH 23/28] Fixed a error that occurred in the `ReflectionHelpers.IsAllowedProperty` method when running on .NET Core 1.0 --- src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs | 9 +++++++++ src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/readme.txt | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs index 304edc0..3331909 100644 --- a/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs +++ b/src/MsieJavaScriptEngine/Helpers/ReflectionHelpers.cs @@ -262,6 +262,15 @@ private MemberComparer() public override bool Equals(T x, T y) { + if (x == null && y == null) + { + return true; + } + else if (x == null || y == null) + { + return false; + } + return x.Module == y.Module #if !NETSTANDARD1_3 && x.MetadataToken == y.MetadataToken diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 1ce2b1a..e312cb6 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -25,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - JSON2 library was updated to version of May 10, 2023. + Fixed a error that occurred in the `ReflectionHelpers.IsAllowedProperty` method when running on .NET Core 1.0. en-US ../../nuget true diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 912fcad..d393488 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,7 +21,8 @@ ============= RELEASE NOTES ============= - JSON2 library was updated to version of May 10, 2023. + Fixed a error that occurred in the `ReflectionHelpers.IsAllowedProperty` method + when running on .NET Core 1.0. ============ PROJECT SITE From c848af9a5225fe90cac52dae558086ae8b605dcc Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Mon, 8 Jan 2024 19:11:55 +0300 Subject: [PATCH 24/28] Version 3.2.4 --- CHANGELOG.md | 3 +++ LICENSE.txt | 2 +- build/common.props | 2 +- src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 2 +- src/MsieJavaScriptEngine/package.json | 2 +- src/MsieJavaScriptEngine/readme.txt | 4 ++-- .../MsieJavaScriptEngine.Benchmarks.csproj | 4 ++-- .../MsieJavaScriptEngine.Test.Auto.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraActiveScript.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 2 +- .../MsieJavaScriptEngine.Test.Classic.csproj | 2 +- .../MsieJavaScriptEngine.Test.Common.csproj | 2 +- 13 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78e3d5e..53a8522 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Change log ========== +## v3.2.4 - January 8, 2024 + * Fixed a error that occurred in the `ReflectionHelpers.IsAllowedProperty` method when running on .NET Core 1.0 + ## v3.2.3 - December 6, 2023 * JSON2 library was updated to version of May 10, 2023 diff --git a/LICENSE.txt b/LICENSE.txt index 55c4d50..6e8f77b 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ - Copyright (c) 2012-2023 Andrey Taritsyn - http://www.taritsyn.ru + Copyright (c) 2012-2024 Andrey Taritsyn - http://www.taritsyn.ru Apache License Version 2.0, January 2004 diff --git a/build/common.props b/build/common.props index 96e62fb..97ace32 100644 --- a/build/common.props +++ b/build/common.props @@ -1,5 +1,5 @@ - Copyright © 2012-2023 Andrey Taritsyn + Copyright © 2012-2024 Andrey Taritsyn \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index e312cb6..48253bf 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine for .NET - 3.2.3 + 3.2.4 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 7.3 diff --git a/src/MsieJavaScriptEngine/package.json b/src/MsieJavaScriptEngine/package.json index 5561b6a..646111d 100644 --- a/src/MsieJavaScriptEngine/package.json +++ b/src/MsieJavaScriptEngine/package.json @@ -1,6 +1,6 @@ { "name": "MsieJavaScriptEngine", - "version": "3.2.3", + "version": "3.2.4", "devDependencies": { "uglify-js": "3.16.1" }, diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index d393488..93b7407 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,11 +1,11 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.2.3 + README file for MSIE JavaScript Engine for .NET v3.2.4 -------------------------------------------------------------------------------- - Copyright (c) 2012-2023 Andrey Taritsyn - http://www.taritsyn.ru + Copyright (c) 2012-2024 Andrey Taritsyn - http://www.taritsyn.ru =========== diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index a84d2bb..b36724c 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Benchmarks - 3.2.3 + 3.2.4 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Exe true @@ -12,7 +12,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index f864fa1..0f03f7e 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.2.3 + 3.2.4 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index f7a318d..40a36a0 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.2.3 + 3.2.4 net462 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 0716698..162453a 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.2.3 + 3.2.4 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index c97a986..12a21d8 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.2.3 + 3.2.4 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index 3bfafa1..c88e8d8 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.2.3 + 3.2.4 net462 Library latest diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 69a5920..4acc1e5 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,7 +2,7 @@ MSIE JavaScript Engine: Common Tests - 3.2.3 + 3.2.4 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library latest From 6090bc7ce98dfc178482dda8b1f7b77459d568e0 Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Fri, 1 Mar 2024 13:18:25 +0300 Subject: [PATCH 25/28] Changed a `.gitignore` file --- .gitignore | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 40f5ee9..00376ec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,15 +2,23 @@ [Bb]in/ [Oo]bj/ +# Node.js tools +node_modules/ +package-lock.json + # NUnit test results TestResult.xml +# BenchmarkDotNet artifacts +BenchmarkDotNet.Artifacts/ + ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files .vs/ .vscode/ +.idea/ *.sln.docstates *.suo *.user @@ -53,6 +61,7 @@ PublishProfiles/ # NuGet Packages packages/ *.nupkg +*.snupkg # Others .build/ @@ -70,4 +79,8 @@ packages/ _UpgradeReport_Files/ Backup*/ UpgradeLog.htm -UpgradeLog*.XML \ No newline at end of file +UpgradeLog*.XML + +# Current project-specific folders and files +nuget/ +**/Resources/*.min.js \ No newline at end of file From 1a7d2c766ca3a89194de9cb1eeeb0920c51611ea Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Fri, 1 Mar 2024 16:12:44 +0300 Subject: [PATCH 26/28] PackageLicenseFile -> PackageLicenseExpression --- src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 48253bf..c024fcc 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -14,8 +14,7 @@ $(Product) Andrey Taritsyn This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript (https://github.com/anaisbetts/SassAndCoffee), Chakra Sample Hosts (https://github.com/panopticoncentral/chakra-host) and jsrt-dotnet (https://github.com/robpaveza/jsrt-dotnet). - LICENSE.txt - false + Apache-2.0 https://github.com/Taritsyn/MsieJavaScriptEngine https://raw.githubusercontent.com/Taritsyn/MsieJavaScriptEngine/master/images/MsieJavaScriptEngine_Logo_128x128.png icon.png @@ -65,7 +64,7 @@ false - $(PackageLicenseFile) + / true false @@ -76,7 +75,7 @@ - readme.txt + / true From 2199a203bbce2148dce8fa615c52e60b9b1dc1bf Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Fri, 1 Mar 2024 18:01:35 +0300 Subject: [PATCH 27/28] Added a `README.md` file to NuGet package --- global.json | 2 +- src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 9 +++++++-- src/MsieJavaScriptEngine/PACKAGE-DESCRIPTION.md | 2 ++ src/MsieJavaScriptEngine/readme.txt | 3 +-- 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 src/MsieJavaScriptEngine/PACKAGE-DESCRIPTION.md diff --git a/global.json b/global.json index 5ce8495..338c555 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100" + "version": "8.0.200" } } diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index c024fcc..9445f25 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -13,7 +13,8 @@ true $(Product) Andrey Taritsyn - This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript (https://github.com/anaisbetts/SassAndCoffee), Chakra Sample Hosts (https://github.com/panopticoncentral/chakra-host) and jsrt-dotnet (https://github.com/robpaveza/jsrt-dotnet). + This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy. + README.md Apache-2.0 https://github.com/Taritsyn/MsieJavaScriptEngine https://raw.githubusercontent.com/Taritsyn/MsieJavaScriptEngine/master/images/MsieJavaScriptEngine_Logo_128x128.png @@ -24,7 +25,7 @@ true snupkg JavaScript;ECMAScript;MSIE;IE;Edge;Chakra - Fixed a error that occurred in the `ReflectionHelpers.IsAllowedProperty` method when running on .NET Core 1.0. + Added a `README.md` file to NuGet package. en-US ../../nuget true @@ -74,6 +75,10 @@ false + + $(PackageReadmeFile) + true + / true diff --git a/src/MsieJavaScriptEngine/PACKAGE-DESCRIPTION.md b/src/MsieJavaScriptEngine/PACKAGE-DESCRIPTION.md new file mode 100644 index 0000000..85c08b4 --- /dev/null +++ b/src/MsieJavaScriptEngine/PACKAGE-DESCRIPTION.md @@ -0,0 +1,2 @@ +This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge Legacy (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). +Project was based on the code of [SassAndCoffee.JavaScript](https://github.com/anaisbetts/SassAndCoffee), [Chakra Sample Hosts](https://github.com/panopticoncentral/chakra-host) and [jsrt-dotnet](https://github.com/robpaveza/jsrt-dotnet). \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 93b7407..05ba2c4 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -21,8 +21,7 @@ ============= RELEASE NOTES ============= - Fixed a error that occurred in the `ReflectionHelpers.IsAllowedProperty` method - when running on .NET Core 1.0. + Added a `README.md` file to NuGet package. ============ PROJECT SITE From 7c2dcede7cd2d18f5b5940d84f59f0823df3817b Mon Sep 17 00:00:00 2001 From: Taritsyn Date: Fri, 1 Mar 2024 19:38:50 +0300 Subject: [PATCH 28/28] Version 3.2.5 --- CHANGELOG.md | 3 +++ build/common.props | 2 ++ src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj | 8 ++------ src/MsieJavaScriptEngine/package.json | 2 +- src/MsieJavaScriptEngine/readme.txt | 2 +- .../MsieJavaScriptEngine.Benchmarks.csproj | 3 ++- .../MsieJavaScriptEngine.Test.Auto.csproj | 5 ++--- .../MsieJavaScriptEngine.Test.ChakraActiveScript.csproj | 5 ++--- .../MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj | 5 ++--- .../MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj | 5 ++--- .../MsieJavaScriptEngine.Test.Classic.csproj | 5 ++--- .../MsieJavaScriptEngine.Test.Common.csproj | 5 ++--- 12 files changed, 23 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53a8522..27dd2aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Change log ========== +## v3.2.5 - March 1, 2024 + * Added a `README.md` file to NuGet package + ## v3.2.4 - January 8, 2024 * Fixed a error that occurred in the `ReflectionHelpers.IsAllowedProperty` method when running on .NET Core 1.0 diff --git a/build/common.props b/build/common.props index 97ace32..6a65ecd 100644 --- a/build/common.props +++ b/build/common.props @@ -1,5 +1,7 @@ Copyright © 2012-2024 Andrey Taritsyn + false + false \ No newline at end of file diff --git a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj index 9445f25..aa70849 100644 --- a/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj +++ b/src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj @@ -2,10 +2,9 @@ MSIE JavaScript Engine for .NET - 3.2.4 + 3.2.5 net40-client;net45;netstandard1.3;netstandard2.0 1.6.0 - 7.3 Library true $(NoWarn);CS1591;NU1605 @@ -29,8 +28,6 @@ en-US ../../nuget true - false - false @@ -38,8 +35,7 @@ - - + diff --git a/src/MsieJavaScriptEngine/package.json b/src/MsieJavaScriptEngine/package.json index 646111d..2d65043 100644 --- a/src/MsieJavaScriptEngine/package.json +++ b/src/MsieJavaScriptEngine/package.json @@ -1,6 +1,6 @@ { "name": "MsieJavaScriptEngine", - "version": "3.2.4", + "version": "3.2.5", "devDependencies": { "uglify-js": "3.16.1" }, diff --git a/src/MsieJavaScriptEngine/readme.txt b/src/MsieJavaScriptEngine/readme.txt index 05ba2c4..c1ec1c6 100644 --- a/src/MsieJavaScriptEngine/readme.txt +++ b/src/MsieJavaScriptEngine/readme.txt @@ -1,7 +1,7 @@  -------------------------------------------------------------------------------- - README file for MSIE JavaScript Engine for .NET v3.2.4 + README file for MSIE JavaScript Engine for .NET v3.2.5 -------------------------------------------------------------------------------- diff --git a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj index b36724c..6a69fbb 100644 --- a/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj +++ b/test/MsieJavaScriptEngine.Benchmarks/MsieJavaScriptEngine.Benchmarks.csproj @@ -2,10 +2,11 @@ MSIE JavaScript Engine: Benchmarks - 3.2.4 + 3.2.5 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Exe true + true false diff --git a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj index 0f03f7e..59d8bc1 100644 --- a/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj +++ b/test/MsieJavaScriptEngine.Test.Auto/MsieJavaScriptEngine.Test.Auto.csproj @@ -2,10 +2,9 @@ MSIE JavaScript Engine: Tests for Auto Mode - 3.2.4 + 3.2.5 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library - latest true true false @@ -14,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj index 40a36a0..45a6f86 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraActiveScript/MsieJavaScriptEngine.Test.ChakraActiveScript.csproj @@ -2,10 +2,9 @@ MSIE JavaScript Engine: Tests for Chakra ActiveScript Mode - 3.2.4 + 3.2.5 net462 Library - latest true true false @@ -14,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj index 162453a..db28d38 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraEdgeJsRt/MsieJavaScriptEngine.Test.ChakraEdgeJsRt.csproj @@ -2,10 +2,9 @@ MSIE JavaScript Engine: Tests for Chakra Edge JsRT Mode - 3.2.4 + 3.2.5 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library - latest true true false @@ -14,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj index 12a21d8..816d0c4 100644 --- a/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj +++ b/test/MsieJavaScriptEngine.Test.ChakraIeJsRt/MsieJavaScriptEngine.Test.ChakraIeJsRt.csproj @@ -2,10 +2,9 @@ MSIE JavaScript Engine: Tests for Chakra IE JsRT Mode - 3.2.4 + 3.2.5 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library - latest true true false @@ -14,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj index c88e8d8..b14413f 100644 --- a/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj +++ b/test/MsieJavaScriptEngine.Test.Classic/MsieJavaScriptEngine.Test.Classic.csproj @@ -2,10 +2,9 @@ MSIE JavaScript Engine: Tests for Classic Mode - 3.2.4 + 3.2.5 net462 Library - latest true true false @@ -14,7 +13,7 @@ - + diff --git a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj index 4acc1e5..826f89d 100644 --- a/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj +++ b/test/MsieJavaScriptEngine.Test.Common/MsieJavaScriptEngine.Test.Common.csproj @@ -2,10 +2,9 @@ MSIE JavaScript Engine: Common Tests - 3.2.4 + 3.2.5 net462;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 Library - latest true true false @@ -15,7 +14,7 @@ - +