| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b126818 commit 6ce0ef7
22 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,5 +7,5 @@ | |||
| 7 | 7 | ||
| 8 | 8 | #define CLEARSCRIPT_VERSION_STRING "7.0.0" | |
| 9 | 9 | #define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,0,0 | |
| 10 | - #define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.0.0-rc3" | ||
| 10 | + #define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.0.0-rc4" | ||
| 11 | 11 | #define CLEARSCRIPT_FILE_FLAGS VS_FF_PRERELEASE | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,13 +17,13 @@ | |||
| 17 | 17 | [assembly: ComVisible(false)] | |
| 18 | 18 | [assembly: AssemblyVersion("7.0.0")] | |
| 19 | 19 | [assembly: AssemblyFileVersion("7.0.0")] | |
| 20 | - [assembly: AssemblyInformationalVersion("7.0.0-rc3")] | ||
| 20 | + [assembly: AssemblyInformationalVersion("7.0.0-rc4")] | ||
| 21 | 21 | ||
| 22 | 22 | namespace Microsoft.ClearScript.Properties | |
| 23 | 23 | { | |
| 24 | 24 | internal static class ClearScriptVersion | |
| 25 | 25 | { | |
| 26 | 26 | public const string Triad = "7.0.0"; | |
| 27 | - public const string Informational = "7.0.0-rc3"; | ||
| 27 | + public const string Informational = "7.0.0-rc4"; | ||
| 28 | 28 | } | |
| 29 | 29 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ internal interface IV8SplitProxyNative | |||
| 9 | 9 | { | |
| 10 | 10 | #region initialization | |
| 11 | 11 | ||
| 12 | - void V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable); | ||
| 12 | + IntPtr V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable); | ||
| 13 | 13 | ||
| 14 | 14 | #endregion | |
| 15 | 15 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,9 +20,9 @@ private sealed class Impl : IV8SplitProxyNative | |||
| 20 | 20 | ||
| 21 | 21 | #region initialization | |
| 22 | 22 | ||
| 23 | - void IV8SplitProxyNative.V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable) | ||
| 23 | + IntPtr IV8SplitProxyNative.V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable) | ||
| 24 | 24 | { | |
| 25 | - V8SplitProxyManaged_SetMethodTable(pMethodTable); | ||
| 25 | + return V8SplitProxyManaged_SetMethodTable(pMethodTable); | ||
| 26 | 26 | } | |
| 27 | 27 | ||
| 28 | 28 | #endregion | |
@@ -964,7 +964,7 @@ void IV8SplitProxyNative.V8UnitTestSupport_GetStatistics(out ulong isolateCount, | |||
| 964 | 964 | #region initialization | |
| 965 | 965 | ||
| 966 | 966 | [DllImport("ClearScriptV8", CallingConvention = CallingConvention.Cdecl)] | |
| 967 | - private static extern void V8SplitProxyManaged_SetMethodTable( | ||
| 967 | + private static extern IntPtr V8SplitProxyManaged_SetMethodTable( | ||
| 968 | 968 | [In] IntPtr pMethodTable | |
| 969 | 969 | ); | |
| 970 | 970 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,9 +18,9 @@ private sealed class Impl32 : IV8SplitProxyNative | |||
| 18 | 18 | ||
| 19 | 19 | #region initialization | |
| 20 | 20 | ||
| 21 | - void IV8SplitProxyNative.V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable) | ||
| 21 | + IntPtr IV8SplitProxyNative.V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable) | ||
| 22 | 22 | { | |
| 23 | - V8SplitProxyManaged_SetMethodTable(pMethodTable); | ||
| 23 | + return V8SplitProxyManaged_SetMethodTable(pMethodTable); | ||
| 24 | 24 | } | |
| 25 | 25 | ||
| 26 | 26 | #endregion | |
@@ -962,7 +962,7 @@ void IV8SplitProxyNative.V8UnitTestSupport_GetStatistics(out ulong isolateCount, | |||
| 962 | 962 | #region initialization | |
| 963 | 963 | ||
| 964 | 964 | [DllImport("ClearScriptV8-32", CallingConvention = CallingConvention.Cdecl)] | |
| 965 | - private static extern void V8SplitProxyManaged_SetMethodTable( | ||
| 965 | + private static extern IntPtr V8SplitProxyManaged_SetMethodTable( | ||
| 966 | 966 | [In] IntPtr pMethodTable | |
| 967 | 967 | ); | |
| 968 | 968 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,9 +18,9 @@ private sealed class Impl64 : IV8SplitProxyNative | |||
| 18 | 18 | ||
| 19 | 19 | #region initialization | |
| 20 | 20 | ||
| 21 | - void IV8SplitProxyNative.V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable) | ||
| 21 | + IntPtr IV8SplitProxyNative.V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable) | ||
| 22 | 22 | { | |
| 23 | - V8SplitProxyManaged_SetMethodTable(pMethodTable); | ||
| 23 | + return V8SplitProxyManaged_SetMethodTable(pMethodTable); | ||
| 24 | 24 | } | |
| 25 | 25 | ||
| 26 | 26 | #endregion | |
@@ -962,7 +962,7 @@ void IV8SplitProxyNative.V8UnitTestSupport_GetStatistics(out ulong isolateCount, | |||
| 962 | 962 | #region initialization | |
| 963 | 963 | ||
| 964 | 964 | [DllImport("ClearScriptV8-64", CallingConvention = CallingConvention.Cdecl)] | |
| 965 | - private static extern void V8SplitProxyManaged_SetMethodTable( | ||
| 965 | + private static extern IntPtr V8SplitProxyManaged_SetMethodTable( | ||
| 966 | 966 | [In] IntPtr pMethodTable | |
| 967 | 967 | ); | |
| 968 | 968 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,20 +11,23 @@ internal static partial class V8SplitProxyNative | |||
| 11 | 11 | public static void Invoke(Action<IV8SplitProxyNative> action) | |
| 12 | 12 | { | |
| 13 | 13 | var previousScheduledException = MiscHelpers.Exchange(ref V8SplitProxyManaged.ScheduledException, null); | |
| 14 | + var previousMethodTable = instance.V8SplitProxyManaged_SetMethodTable(V8SplitProxyManaged.MethodTable); | ||
| 14 | 15 | try | |
| 15 | 16 | { | |
| 16 | 17 | action(instance); | |
| 17 | 18 | ThrowScheduledException(); | |
| 18 | 19 | } | |
| 19 | 20 | finally | |
| 20 | 21 | { | |
| 22 | + instance.V8SplitProxyManaged_SetMethodTable(previousMethodTable); | ||
| 21 | 23 | V8SplitProxyManaged.ScheduledException = previousScheduledException; | |
| 22 | 24 | } | |
| 23 | 25 | } | |
| 24 | 26 | ||
| 25 | 27 | public static T Invoke<T>(Func<IV8SplitProxyNative, T> func) | |
| 26 | 28 | { | |
| 27 | 29 | var previousScheduledException = MiscHelpers.Exchange(ref V8SplitProxyManaged.ScheduledException, null); | |
| 30 | + var previousMethodTable = instance.V8SplitProxyManaged_SetMethodTable(V8SplitProxyManaged.MethodTable); | ||
| 28 | 31 | try | |
| 29 | 32 | { | |
| 30 | 33 | var result = func(instance); | |
@@ -33,18 +36,35 @@ public static T Invoke<T>(Func<IV8SplitProxyNative, T> func) | |||
| 33 | 36 | } | |
| 34 | 37 | finally | |
| 35 | 38 | { | |
| 39 | + instance.V8SplitProxyManaged_SetMethodTable(previousMethodTable); | ||
| 36 | 40 | V8SplitProxyManaged.ScheduledException = previousScheduledException; | |
| 37 | 41 | } | |
| 38 | 42 | } | |
| 39 | 43 | ||
| 40 | 44 | public static void InvokeNoThrow(Action<IV8SplitProxyNative> action) | |
| 41 | 45 | { | |
| 42 | - action(instance); | ||
| 46 | + var previousMethodTable = instance.V8SplitProxyManaged_SetMethodTable(V8SplitProxyManaged.MethodTable); | ||
| 47 | + try | ||
| 48 | + { | ||
| 49 | + action(instance); | ||
| 50 | + } | ||
| 51 | + finally | ||
| 52 | + { | ||
| 53 | + instance.V8SplitProxyManaged_SetMethodTable(previousMethodTable); | ||
| 54 | + } | ||
| 43 | 55 | } | |
| 44 | 56 | ||
| 45 | 57 | public static T InvokeNoThrow<T>(Func<IV8SplitProxyNative, T> func) | |
| 46 | 58 | { | |
| 47 | - return func(instance); | ||
| 59 | + var previousMethodTable = instance.V8SplitProxyManaged_SetMethodTable(V8SplitProxyManaged.MethodTable); | ||
| 60 | + try | ||
| 61 | + { | ||
| 62 | + return func(instance); | ||
| 63 | + } | ||
| 64 | + finally | ||
| 65 | + { | ||
| 66 | + instance.V8SplitProxyManaged_SetMethodTable(previousMethodTable); | ||
| 67 | + } | ||
| 48 | 68 | } | |
| 49 | 69 | ||
| 50 | 70 | private static void ThrowScheduledException() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,6 @@ | |||
| 7 | 7 | using System.Linq; | |
| 8 | 8 | using System.Text; | |
| 9 | 9 | using Microsoft.ClearScript.Util; | |
| 10 | - using Microsoft.ClearScript.V8.SplitProxy; | ||
| 11 | 10 | ||
| 12 | 11 | namespace Microsoft.ClearScript.V8 | |
| 13 | 12 | { | |
@@ -25,7 +24,6 @@ internal static bool OnEntityHolderCreated() | |||
| 25 | 24 | if (hNativeAssembly == IntPtr.Zero) | |
| 26 | 25 | { | |
| 27 | 26 | hNativeAssembly = LoadNativeAssembly(); | |
| 28 | - V8SplitProxyNative.InvokeNoThrow(instance => instance.V8SplitProxyManaged_SetMethodTable(V8SplitProxyManaged.MethodTable)); | ||
| 29 | 27 | } | |
| 30 | 28 | ||
| 31 | 29 | ++splitImplCount; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,4 +13,4 @@ | |||
| 13 | 13 | [assembly: ComVisible(false)] | |
| 14 | 14 | [assembly: AssemblyVersion("7.0.0")] | |
| 15 | 15 | [assembly: AssemblyFileVersion("7.0.0")] | |
| 16 | - [assembly: AssemblyInformationalVersion("7.0.0-rc3")] | ||
| 16 | + [assembly: AssemblyInformationalVersion("7.0.0-rc4")] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | using System; | |
| 5 | 5 | using System.Collections.Generic; | |
| 6 | + using System.Reflection; | ||
| 6 | 7 | using System.Threading; | |
| 7 | 8 | using Microsoft.ClearScript.V8; | |
| 8 | 9 | using Microsoft.VisualStudio.TestTools.UnitTesting; | |
@@ -11,6 +12,8 @@ namespace Microsoft.ClearScript.Test | |||
| 11 | 12 | { | |
| 12 | 13 | internal static class ConsoleTest | |
| 13 | 14 | { | |
| 15 | + #region test methods | ||
| 16 | + | ||
| 14 | 17 | public static unsafe void BugFix_V8StackLimitIntegerOverflow() | |
| 15 | 18 | { | |
| 16 | 19 | var threads = new List<Thread>(); | |
@@ -72,5 +75,41 @@ public static unsafe void BugFix_V8StackLimitIntegerOverflow() | |||
| 72 | 75 | threads.ForEach(thread => thread.Join()); | |
| 73 | 76 | } | |
| 74 | 77 | } | |
| 78 | + | ||
| 79 | + public static void BugFix_MultipleAppDomains() | ||
| 80 | + { | ||
| 81 | + var domain1 = AppDomain.CreateDomain("domain1"); | ||
| 82 | + var domain2 = AppDomain.CreateDomain("domain2"); | ||
| 83 | + | ||
| 84 | + var obj1 = (MultiAppDomainTest)domain1.CreateInstanceAndUnwrap(Assembly.GetEntryAssembly().FullName, typeof(MultiAppDomainTest).FullName); | ||
| 85 | + var obj2 = (MultiAppDomainTest)domain2.CreateInstanceAndUnwrap(Assembly.GetEntryAssembly().FullName, typeof(MultiAppDomainTest).FullName); | ||
| 86 | + | ||
| 87 | + obj1.CreateEngine(); | ||
| 88 | + obj2.CreateEngine(); | ||
| 89 | + | ||
| 90 | + obj1.DisposeEngine(); | ||
| 91 | + obj2.DisposeEngine(); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + #endregion | ||
| 95 | + | ||
| 96 | + #region miscellaneous | ||
| 97 | + | ||
| 98 | + public class MultiAppDomainTest : MarshalByRefObject | ||
| 99 | + { | ||
| 100 | + private ScriptEngine engine; | ||
| 101 | + | ||
| 102 | + public void CreateEngine() | ||
| 103 | + { | ||
| 104 | + engine = new V8ScriptEngine(); | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + public void DisposeEngine() | ||
| 108 | + { | ||
| 109 | + engine.Dispose(); | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + #endregion | ||
| 75 | 114 | } | |
| 76 | 115 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments