diff --git a/ClearScript/DocumentLoader.cs b/ClearScript/DocumentLoader.cs index c84f6d5cd..1234b8aa9 100644 --- a/ClearScript/DocumentLoader.cs +++ b/ClearScript/DocumentLoader.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.IO; using System.Linq; -using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -406,9 +405,9 @@ private async Task LoadDocumentAsync(DocumentSettings settings, Uri ur } else { - using (var client = new WebClient()) + using (var client = new HttpClient()) { - contents = await client.DownloadStringTaskAsync(uri).ConfigureAwait(false); + contents = await client.GetStringAsync(uri).ConfigureAwait(false); } } diff --git a/ClearScript/Exports/VersionSymbols.h b/ClearScript/Exports/VersionSymbols.h index 9542d85ca..3918a3dd2 100644 --- a/ClearScript/Exports/VersionSymbols.h +++ b/ClearScript/Exports/VersionSymbols.h @@ -7,5 +7,5 @@ #define CLEARSCRIPT_VERSION_STRING "7.1.7" #define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,1,7 -#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.1.7-preview" -#define CLEARSCRIPT_FILE_FLAGS VS_FF_PRERELEASE +#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.1.7" +#define CLEARSCRIPT_FILE_FLAGS 0L diff --git a/ClearScript/Properties/AssemblyInfo.Core.cs b/ClearScript/Properties/AssemblyInfo.Core.cs index ac748557e..b6c991e71 100644 --- a/ClearScript/Properties/AssemblyInfo.Core.cs +++ b/ClearScript/Properties/AssemblyInfo.Core.cs @@ -20,13 +20,13 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("7.1.7")] [assembly: AssemblyFileVersion("7.1.7")] -[assembly: AssemblyInformationalVersion("7.1.7-preview")] +[assembly: AssemblyInformationalVersion("7.1.7")] namespace Microsoft.ClearScript.Properties { internal static class ClearScriptVersion { public const string Triad = "7.1.7"; - public const string Informational = "7.1.7-preview"; + public const string Informational = "7.1.7"; } } diff --git a/ClearScript/Properties/AssemblyInfo.V8.cs b/ClearScript/Properties/AssemblyInfo.V8.cs index 85415c00d..94c671d0f 100644 --- a/ClearScript/Properties/AssemblyInfo.V8.cs +++ b/ClearScript/Properties/AssemblyInfo.V8.cs @@ -17,4 +17,4 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("7.1.7")] [assembly: AssemblyFileVersion("7.1.7")] -[assembly: AssemblyInformationalVersion("7.1.7-preview")] +[assembly: AssemblyInformationalVersion("7.1.7")] diff --git a/ClearScript/Properties/AssemblyInfo.Windows.Core.cs b/ClearScript/Properties/AssemblyInfo.Windows.Core.cs index 532642dc1..52a31bcb4 100644 --- a/ClearScript/Properties/AssemblyInfo.Windows.Core.cs +++ b/ClearScript/Properties/AssemblyInfo.Windows.Core.cs @@ -18,4 +18,4 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("7.1.7")] [assembly: AssemblyFileVersion("7.1.7")] -[assembly: AssemblyInformationalVersion("7.1.7-preview")] +[assembly: AssemblyInformationalVersion("7.1.7")] diff --git a/ClearScript/Properties/AssemblyInfo.Windows.cs b/ClearScript/Properties/AssemblyInfo.Windows.cs index 2c76559a0..1c01239ca 100644 --- a/ClearScript/Properties/AssemblyInfo.Windows.cs +++ b/ClearScript/Properties/AssemblyInfo.Windows.cs @@ -17,4 +17,4 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("7.1.7")] [assembly: AssemblyFileVersion("7.1.7")] -[assembly: AssemblyInformationalVersion("7.1.7-preview")] +[assembly: AssemblyInformationalVersion("7.1.7")] diff --git a/ClearScriptBenchmarks/Properties/AssemblyInfo.cs b/ClearScriptBenchmarks/Properties/AssemblyInfo.cs index a73214aab..60bfe770b 100644 --- a/ClearScriptBenchmarks/Properties/AssemblyInfo.cs +++ b/ClearScriptBenchmarks/Properties/AssemblyInfo.cs @@ -13,4 +13,4 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("7.1.7")] [assembly: AssemblyFileVersion("7.1.7")] -[assembly: AssemblyInformationalVersion("7.1.7-preview")] +[assembly: AssemblyInformationalVersion("7.1.7")] diff --git a/ClearScriptBenchmarks/SunSpider.cs b/ClearScriptBenchmarks/SunSpider.cs index d90bf37f3..67be94833 100644 --- a/ClearScriptBenchmarks/SunSpider.cs +++ b/ClearScriptBenchmarks/SunSpider.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Net; +using System.Net.Http; using System.Text; namespace Microsoft.ClearScript.Test @@ -113,9 +113,9 @@ private static int RunTest(ScriptEngine engine, MockDOM mockDOM, int index) private static string DownloadFileAsString(string name) { - using (var client = new WebClient()) + using (var client = new HttpClient()) { - return client.DownloadString(baseUrl + name); + return client.GetStringAsync(baseUrl + name).Result; } } diff --git a/ClearScriptConsole/ConsoleTest.cs b/ClearScriptConsole/ConsoleTest.cs index b3571da89..e0a4242b1 100644 --- a/ClearScriptConsole/ConsoleTest.cs +++ b/ClearScriptConsole/ConsoleTest.cs @@ -78,9 +78,13 @@ public static unsafe void BugFix_V8StackLimitIntegerOverflow() public static void BugFix_MultipleAppDomains() { + #pragma warning disable SYSLIB0024 // Creating and unloading AppDomains is not supported and throws an exception + var domain1 = AppDomain.CreateDomain("domain1"); var domain2 = AppDomain.CreateDomain("domain2"); + #pragma warning restore SYSLIB0024 // Creating and unloading AppDomains is not supported and throws an exception + var obj1 = (MultiAppDomainTest)domain1.CreateInstanceAndUnwrap(Assembly.GetEntryAssembly().FullName, typeof(MultiAppDomainTest).FullName); var obj2 = (MultiAppDomainTest)domain2.CreateInstanceAndUnwrap(Assembly.GetEntryAssembly().FullName, typeof(MultiAppDomainTest).FullName); diff --git a/ClearScriptConsole/Properties/AssemblyInfo.cs b/ClearScriptConsole/Properties/AssemblyInfo.cs index 4f6e949c7..cffca1b7f 100644 --- a/ClearScriptConsole/Properties/AssemblyInfo.cs +++ b/ClearScriptConsole/Properties/AssemblyInfo.cs @@ -13,4 +13,4 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("7.1.7")] [assembly: AssemblyFileVersion("7.1.7")] -[assembly: AssemblyInformationalVersion("7.1.7-preview")] +[assembly: AssemblyInformationalVersion("7.1.7")] diff --git a/ClearScriptTest/BugFixTest.cs b/ClearScriptTest/BugFixTest.cs index f1a827c69..2d70435f3 100644 --- a/ClearScriptTest/BugFixTest.cs +++ b/ClearScriptTest/BugFixTest.cs @@ -1506,6 +1506,25 @@ public void BugFix_DefaultDocumentLoader_RedundantWebChecks() Assert.AreEqual(10, statistics.WebCheckCount); } + [TestMethod, TestCategory("BugFix")] + public void BugFix_V8_DisableGlobalMembers_IterationProtocol() + { + engine.Script.test = new[] { "one", "two", "three" }; + Assert.AreEqual(3, ((dynamic)engine.Evaluate("Array.from(test)")).length); + Assert.AreEqual("one", ((dynamic)engine.Evaluate("Array.from(test)"))[0]); + Assert.AreEqual("two", ((dynamic)engine.Evaluate("Array.from(test)"))[1]); + Assert.AreEqual("three", ((dynamic)engine.Evaluate("Array.from(test)"))[2]); + + engine.Dispose(); + engine = new V8ScriptEngine(V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.DisableGlobalMembers); + + engine.Script.data = new[] { "foo", "bar", "baz" }; + Assert.AreEqual(3, ((dynamic)engine.Evaluate("Array.from(data)")).length); + Assert.AreEqual("foo", ((dynamic)engine.Evaluate("Array.from(data)"))[0]); + Assert.AreEqual("bar", ((dynamic)engine.Evaluate("Array.from(data)"))[1]); + Assert.AreEqual("baz", ((dynamic)engine.Evaluate("Array.from(data)"))[2]); + } + // ReSharper restore InconsistentNaming #endregion @@ -1820,14 +1839,14 @@ public static async Task GetStringAsync() return "foo"; } - #pragma warning disable 1998 + #pragma warning disable 1998 // This async method lacks 'await' operators and will run synchronously public static async Task GetStringQuicklyAsync() { return "foo"; } - #pragma warning restore 1998 + #pragma warning restore 1998 // This async method lacks 'await' operators and will run synchronously } diff --git a/ClearScriptTest/Properties/AssemblyInfo.cs b/ClearScriptTest/Properties/AssemblyInfo.cs index 06b17a2cf..09525c23d 100644 --- a/ClearScriptTest/Properties/AssemblyInfo.cs +++ b/ClearScriptTest/Properties/AssemblyInfo.cs @@ -13,4 +13,4 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("7.1.7")] [assembly: AssemblyFileVersion("7.1.7")] -[assembly: AssemblyInformationalVersion("7.1.7-preview")] +[assembly: AssemblyInformationalVersion("7.1.7")] diff --git a/ClearScriptV8/V8ContextImpl.cpp b/ClearScriptV8/V8ContextImpl.cpp index 9adf2fbfd..5347605bf 100644 --- a/ClearScriptV8/V8ContextImpl.cpp +++ b/ClearScriptV8/V8ContextImpl.cpp @@ -254,8 +254,7 @@ V8ContextImpl::V8ContextImpl(SharedPtr&& spIsolateImpl, const Std auto hGlobal = ::ValueAsObject(m_hContext->Global()->GetPrototype()); if (!hGlobal.IsEmpty() && (hGlobal->InternalFieldCount() > 0)) { - m_hGlobal = CreatePersistent(hGlobal); - m_hGlobal->SetAlignedPointerInInternalField(0, this); + hGlobal->SetAlignedPointerInInternalField(0, this); } } @@ -1491,14 +1490,10 @@ void V8ContextImpl::Teardown() // As of V8 3.16.0, the global property getter for a disposed context // may be invoked during GC after the V8ContextImpl instance is gone. - if (!m_hGlobal.IsEmpty()) + auto hGlobal = ::ValueAsObject(m_hContext->Global()->GetPrototype()); + if (!hGlobal.IsEmpty() && (hGlobal->InternalFieldCount() > 0)) { - if (m_hGlobal->InternalFieldCount() > 0) - { - m_hGlobal->SetAlignedPointerInInternalField(0, nullptr); - } - - Dispose(m_hGlobal); + hGlobal->SetAlignedPointerInInternalField(0, nullptr); } Dispose(m_hContext); @@ -2049,7 +2044,7 @@ void V8ContextImpl::GetHostObjectIterator(const v8::FunctionCallbackInfom_hToIteratorFunction.IsEmpty()) { - auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hGlobal->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("EngineInternal")))))).As(); + auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hContext->Global()->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("EngineInternal")))))).As(); pContextImpl->m_hToIteratorFunction = pContextImpl->CreatePersistent(FROM_MAYBE(hEngineInternal->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("toIterator")))))).As()); } @@ -2083,7 +2078,7 @@ void V8ContextImpl::GetHostObjectAsyncIterator(const v8::FunctionCallbackInfom_hToAsyncIteratorFunction.IsEmpty()) { - auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hGlobal->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("EngineInternal")))))).As(); + auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hContext->Global()->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("EngineInternal")))))).As(); pContextImpl->m_hToAsyncIteratorFunction = pContextImpl->CreatePersistent(FROM_MAYBE(hEngineInternal->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("toAsyncIterator")))))).As()); } diff --git a/ClearScriptV8/V8ContextImpl.h b/ClearScriptV8/V8ContextImpl.h index 3160a2899..5fe0f81a2 100644 --- a/ClearScriptV8/V8ContextImpl.h +++ b/ClearScriptV8/V8ContextImpl.h @@ -436,7 +436,6 @@ class V8ContextImpl final: public V8Context SharedPtr m_spIsolateImpl; bool m_DateTimeConversionEnabled; Persistent m_hContext; - Persistent m_hGlobal; std::vector>> m_GlobalMembersStack; Persistent m_hIsHostObjectKey; Persistent m_hHostExceptionKey; diff --git a/ClearScriptV8/win-arm64/ClearScriptV8.win-arm64.vcxproj b/ClearScriptV8/win-arm64/ClearScriptV8.win-arm64.vcxproj index 196edcaf8..0688eb916 100644 --- a/ClearScriptV8/win-arm64/ClearScriptV8.win-arm64.vcxproj +++ b/ClearScriptV8/win-arm64/ClearScriptV8.win-arm64.vcxproj @@ -28,6 +28,10 @@ Unicode true + + v143 + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + v142 $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) @@ -83,6 +87,7 @@ MultiThreadedDebug + DebugFull DebugFull DebugFull true @@ -119,6 +124,7 @@ MultiThreaded + DebugFull DebugFull DebugFull true diff --git a/ClearScriptV8/win-x64/ClearScriptV8.win-x64.vcxproj b/ClearScriptV8/win-x64/ClearScriptV8.win-x64.vcxproj index 07974094c..fd1cb17ad 100644 --- a/ClearScriptV8/win-x64/ClearScriptV8.win-x64.vcxproj +++ b/ClearScriptV8/win-x64/ClearScriptV8.win-x64.vcxproj @@ -28,6 +28,10 @@ Unicode true + + v143 + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + v142 $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) @@ -83,6 +87,7 @@ MultiThreadedDebug + DebugFull DebugFull DebugFull true @@ -119,6 +124,7 @@ MultiThreaded + DebugFull DebugFull DebugFull true diff --git a/ClearScriptV8/win-x86/ClearScriptV8.win-x86.vcxproj b/ClearScriptV8/win-x86/ClearScriptV8.win-x86.vcxproj index 78fdc19ca..7a8d5a78b 100644 --- a/ClearScriptV8/win-x86/ClearScriptV8.win-x86.vcxproj +++ b/ClearScriptV8/win-x86/ClearScriptV8.win-x86.vcxproj @@ -28,6 +28,10 @@ Unicode true + + v143 + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + v142 $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) @@ -82,6 +86,7 @@ MultiThreadedDebug + DebugFull DebugFull DebugFull true @@ -118,6 +123,7 @@ MultiThreaded + DebugFull DebugFull DebugFull true diff --git a/NetFramework/ClearScriptBenchmarks/ClearScriptBenchmarks.csproj b/NetFramework/ClearScriptBenchmarks/ClearScriptBenchmarks.csproj index b4fa8655c..6ac373edc 100644 --- a/NetFramework/ClearScriptBenchmarks/ClearScriptBenchmarks.csproj +++ b/NetFramework/ClearScriptBenchmarks/ClearScriptBenchmarks.csproj @@ -46,6 +46,7 @@ + diff --git a/Unix/V8Update.sh b/Unix/V8Update.sh index 4bd092366..3eb3f3395 100644 --- a/Unix/V8Update.sh +++ b/Unix/V8Update.sh @@ -1,6 +1,6 @@ #!/bin/bash -v8testedrev=9.5.172.13 +v8testedrev=9.5.172.21 v8testedcommit= if [[ $v8testedcommit == "" ]]; then diff --git a/V8/V8Patch.txt b/V8/V8Patch.txt index 89d363ee7..aa0334b60 100644 --- a/V8/V8Patch.txt +++ b/V8/V8Patch.txt @@ -1,5 +1,5 @@ diff --git a/BUILD.gn b/BUILD.gn -index 5c7d931b27..d64217a502 100644 +index 5c7d931b27..665f145a6a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -970,7 +970,7 @@ config("toolchain") { diff --git a/V8Update.cmd b/V8Update.cmd index 624a389e1..e5dfde1b7 100644 --- a/V8Update.cmd +++ b/V8Update.cmd @@ -1,7 +1,7 @@ @echo off setlocal -set v8testedrev=9.5.172.13 +set v8testedrev=9.5.172.21 set v8testedcommit= if not "%v8testedcommit%"=="" goto ProcessArgs diff --git a/Version.tt b/Version.tt index f2369495a..be3645278 100644 --- a/Version.tt +++ b/Version.tt @@ -1,5 +1,5 @@ <# var version = new Version(7, 1, 7); - var versionSuffix = "-preview"; + var versionSuffix = string.Empty; new Random(versionSuffix.Length); // suppress "versionSuffix not used" warning #>