ClearScript 7.2: Added V8ScriptEngine.CancelAwaitDebugger (GitHub Issue #309); added support for BigInt64Array and BigUint64Array; (V8) same-runtime engines get direct access to all shared objects (related to GitHub Issue #308); (V8) typed arrays and data views based on SharedArrayBuffer can be shared across runtimes (GitHub Issue #317); improved V8-to-host invocation performance; updated build and API documentation. Tested with V8 9.6.180.14.

This commit is contained in:
ClearScript 2021-11-22 07:45:53 -08:00
Родитель 176b1391ac
Коммит d5f5baa17c
692 изменённых файлов: 2973 добавлений и 1568 удалений

Просмотреть файл

@ -5,7 +5,7 @@
#pragma once
#define CLEARSCRIPT_VERSION_STRING "7.1.7"
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,1,7
#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.1.7"
#define CLEARSCRIPT_VERSION_STRING "7.2.0"
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,2,0
#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.2.0"
#define CLEARSCRIPT_FILE_FLAGS 0L

Просмотреть файл

@ -1641,11 +1641,13 @@ namespace Microsoft.ClearScript
}
var value = args[args.Length - 1];
if ((value != null) && Engine.GetType().IsGuidType<TypeGuidMocks.VBScriptEngine>())
// ReSharper disable once SuspiciousTypeConversion.Global
if ((value != null) && (Engine is IVBScriptEngineTag))
{
// special case to emulate VBScript's default property handling
if (value.GetType().IsGuidType<TypeGuidMocks.WindowsScriptItem>())
if (value is IWindowsScriptItemTag)
{
var defaultValue = ((IDynamic)value).GetProperty(SpecialMemberNames.Default);
if (!(defaultValue is Undefined))

Просмотреть файл

@ -58,6 +58,14 @@ namespace Microsoft.ClearScript.JavaScript
/// <term><c>ITypedArray&#x3C;int&#x3E;</c></term>
/// </item>
/// <item>
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array">BigUint64Array</see></term>
/// <term><c>ITypedArray&#x3C;ulong&#x3E;</c></term>
/// </item>
/// <item>
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array">BigInt64Array</see></term>
/// <term><c>ITypedArray&#x3C;long&#x3E;</c></term>
/// </item>
/// <item>
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array">Float32Array</see></term>
/// <term><c>ITypedArray&#x3C;float&#x3E;</c></term>
/// </item>

Просмотреть файл

@ -18,15 +18,15 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo("ClearScriptTest")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.7")]
[assembly: AssemblyFileVersion("7.1.7")]
[assembly: AssemblyInformationalVersion("7.1.7")]
[assembly: AssemblyVersion("7.2.0")]
[assembly: AssemblyFileVersion("7.2.0")]
[assembly: AssemblyInformationalVersion("7.2.0")]
namespace Microsoft.ClearScript.Properties
{
internal static class ClearScriptVersion
{
public const string Triad = "7.1.7";
public const string Informational = "7.1.7";
public const string Triad = "7.2.0";
public const string Informational = "7.2.0";
}
}

Просмотреть файл

@ -15,6 +15,6 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo("ClearScriptTest")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.7")]
[assembly: AssemblyFileVersion("7.1.7")]
[assembly: AssemblyInformationalVersion("7.1.7")]
[assembly: AssemblyVersion("7.2.0")]
[assembly: AssemblyFileVersion("7.2.0")]
[assembly: AssemblyInformationalVersion("7.2.0")]

Просмотреть файл

@ -16,6 +16,6 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo("ClearScriptTest")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.7")]
[assembly: AssemblyFileVersion("7.1.7")]
[assembly: AssemblyInformationalVersion("7.1.7")]
[assembly: AssemblyVersion("7.2.0")]
[assembly: AssemblyFileVersion("7.2.0")]
[assembly: AssemblyInformationalVersion("7.2.0")]

Просмотреть файл

@ -15,6 +15,6 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo("ClearScriptTest")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.7")]
[assembly: AssemblyFileVersion("7.1.7")]
[assembly: AssemblyInformationalVersion("7.1.7")]
[assembly: AssemblyVersion("7.2.0")]
[assembly: AssemblyFileVersion("7.2.0")]
[assembly: AssemblyInformationalVersion("7.2.0")]

Просмотреть файл

@ -1,22 +0,0 @@
using System.Runtime.InteropServices;
namespace Microsoft.ClearScript.Util
{
internal static class TypeGuidMocks
{
[Guid(TypeGuids.Nothing)]
public abstract class Nothing
{
}
[Guid(TypeGuids.VBScriptEngine)]
public abstract class VBScriptEngine
{
}
[Guid(TypeGuids.WindowsScriptItem)]
public abstract class WindowsScriptItem
{
}
}
}

Просмотреть файл

@ -1,12 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
namespace Microsoft.ClearScript.Util
{
internal static class TypeGuids
{
public const string Nothing = "B46C89DF-10BC-4789-9A70-632BCE55A37A";
public const string VBScriptEngine = "E3F03267-D091-40D1-B0D2-18B892DBC684";
public const string WindowsScriptItem = "A45601CC-89E0-445B-B4F4-C4BB0F90C293";
}
}

Просмотреть файл

@ -328,21 +328,6 @@ namespace Microsoft.ClearScript.Util
return false;
}
public static bool IsGuidType<T>(this Type type)
{
while (type != null)
{
if (type.GUID == typeof(T).GUID)
{
return true;
}
type = type.BaseType;
}
return false;
}
public static string GetRootName(this Type type)
{
return StripGenericSuffix(type.Name);

Просмотреть файл

@ -0,0 +1,14 @@
namespace Microsoft.ClearScript.Util
{
internal interface INothingTag
{
}
internal interface IVBScriptEngineTag
{
}
internal interface IWindowsScriptItemTag
{
}
}

Просмотреть файл

@ -20,10 +20,11 @@ namespace Microsoft.ClearScript.V8
object Invoke(bool asConstructor, object[] args);
object InvokeMethod(string name, object[] args);
bool IsPromise();
bool IsArray();
bool IsPromise { get; }
bool IsArray { get; }
bool IsShared { get; }
bool IsArrayBufferOrView();
bool IsArrayBufferOrView { get; }
V8ArrayBufferOrViewKind GetArrayBufferOrViewKind();
V8ArrayBufferOrViewInfo GetArrayBufferOrViewInfo();
void InvokeWithArrayBufferOrViewData(Action<IntPtr> action);

Просмотреть файл

@ -108,7 +108,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
void V8Value_SetString(V8Value.Ptr pV8Value, string value);
void V8Value_SetDateTime(V8Value.Ptr pV8Value, double value);
void V8Value_SetBigInt(V8Value.Ptr pV8Value, int signBit, byte[] bytes);
void V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype);
void V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags);
void V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject);
V8Value.Type V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle);
void V8Value_Delete(V8Value.Ptr pV8Value);
@ -136,6 +136,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
UIntPtr V8Isolate_GetMaxStackUsage(V8Isolate.Handle hIsolate);
void V8Isolate_SetMaxStackUsage(V8Isolate.Handle hIsolate, UIntPtr size);
void V8Isolate_AwaitDebuggerAndPause(V8Isolate.Handle hIsolate);
void V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate);
V8Script.Handle V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code);
V8Script.Handle V8Isolate_CompileProducingCache(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, V8CacheKind cacheKind, out byte[] cacheBytes);
V8Script.Handle V8Isolate_CompileConsumingCache(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, V8CacheKind cacheKind, byte[] cacheBytes, out bool cacheAccepted);
@ -163,6 +164,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
object V8Context_GetRootItem(V8Context.Handle hContext);
void V8Context_AddGlobalItem(V8Context.Handle hContext, string name, object value, bool globalMembers);
void V8Context_AwaitDebuggerAndPause(V8Context.Handle hContext);
void V8Context_CancelAwaitDebugger(V8Context.Handle hContext);
object V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate);
V8Script.Handle V8Context_Compile(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code);
V8Script.Handle V8Context_CompileProducingCache(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, V8CacheKind cacheKind, out byte[] cacheBytes);

Просмотреть файл

@ -64,6 +64,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8SplitProxyNative.Invoke(instance => instance.V8Context_AwaitDebuggerAndPause(Handle));
}
public override void CancelAwaitDebugger()
{
V8SplitProxyNative.Invoke(instance => instance.V8Context_CancelAwaitDebugger(Handle));
}
public override object Execute(UniqueDocumentInfo documentInfo, string code, bool evaluate)
{
return V8SplitProxyNative.Invoke(instance => instance.V8Context_ExecuteCode(

Просмотреть файл

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
@ -69,6 +69,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8SplitProxyNative.Invoke(instance => instance.V8Isolate_AwaitDebuggerAndPause(Handle));
}
public override void CancelAwaitDebugger()
{
V8SplitProxyNative.Invoke(instance => instance.V8Isolate_CancelAwaitDebugger(Handle));
}
public override V8.V8Script Compile(UniqueDocumentInfo documentInfo, string code)
{
return new V8ScriptImpl(documentInfo, code.GetDigest(), V8SplitProxyNative.Invoke(instance => instance.V8Isolate_Compile(

Просмотреть файл

@ -11,14 +11,17 @@ namespace Microsoft.ClearScript.V8.SplitProxy
public V8Object.Handle Handle => (V8Object.Handle)holder.Handle;
public V8ObjectImpl(V8Object.Handle hObject, V8Value.Subtype subtype)
public V8ObjectImpl(V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
holder = new V8EntityHolder("V8 object", () => hObject);
Subtype = subtype;
Flags = flags;
}
public V8Value.Subtype Subtype { get; }
public V8Value.Flags Flags { get; }
#region IV8Object implementation
public object GetProperty(string name)
@ -71,19 +74,37 @@ namespace Microsoft.ClearScript.V8.SplitProxy
return V8SplitProxyNative.Invoke(instance => instance.V8Object_InvokeMethod(Handle, name, args));
}
public bool IsPromise()
{
return Subtype == V8Value.Subtype.Promise;
}
public bool IsPromise => Subtype == V8Value.Subtype.Promise;
public bool IsArray()
{
return Subtype == V8Value.Subtype.Array;
}
public bool IsArray => Subtype == V8Value.Subtype.Array;
public bool IsArrayBufferOrView()
public bool IsShared => Flags.HasFlag(V8Value.Flags.Shared);
public bool IsArrayBufferOrView
{
return (Subtype != V8Value.Subtype.None) && (Subtype != V8Value.Subtype.Array);
get
{
switch (Subtype)
{
case V8Value.Subtype.ArrayBuffer:
case V8Value.Subtype.DataView:
case V8Value.Subtype.Uint8Array:
case V8Value.Subtype.Uint8ClampedArray:
case V8Value.Subtype.Int8Array:
case V8Value.Subtype.Uint16Array:
case V8Value.Subtype.Int16Array:
case V8Value.Subtype.Uint32Array:
case V8Value.Subtype.Int32Array:
case V8Value.Subtype.BigUint64Array:
case V8Value.Subtype.BigInt64Array:
case V8Value.Subtype.Float32Array:
case V8Value.Subtype.Float64Array:
return true;
default:
return false;
}
}
}
public V8ArrayBufferOrViewKind GetArrayBufferOrViewKind()
@ -108,6 +129,10 @@ namespace Microsoft.ClearScript.V8.SplitProxy
kind = V8ArrayBufferOrViewKind.Uint32Array;
else if (Subtype == V8Value.Subtype.Int32Array)
kind = V8ArrayBufferOrViewKind.Int32Array;
else if (Subtype == V8Value.Subtype.BigUint64Array)
kind = V8ArrayBufferOrViewKind.BigUint64Array;
else if (Subtype == V8Value.Subtype.BigInt64Array)
kind = V8ArrayBufferOrViewKind.BigInt64Array;
else if (Subtype == V8Value.Subtype.Float32Array)
kind = V8ArrayBufferOrViewKind.Float32Array;
else if (Subtype == V8Value.Subtype.Float64Array)
@ -122,9 +147,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
if (kind != V8ArrayBufferOrViewKind.None)
{
IV8Object arrayBuffer = null;
ulong offset = 0;
ulong size = 0;
ulong length = 0;
var offset = 0UL;
var size = 0UL;
var length = 0UL;
V8SplitProxyNative.Invoke(instance => instance.V8Object_GetArrayBufferOrViewInfo(Handle, out arrayBuffer, out offset, out size, out length));
return new V8ArrayBufferOrViewInfo(kind, arrayBuffer, offset, size, length);
}

Просмотреть файл

@ -35,10 +35,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -136,10 +133,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -231,10 +225,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -326,10 +317,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -421,10 +409,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -516,10 +501,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -611,10 +593,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -720,10 +699,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -956,7 +932,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
return TryGetBigInteger(intValue, (int)uintValue, ptrOrHandle, out var result) ? (object)result : null;
case Type.V8Object:
return new V8ObjectImpl((V8Object.Handle)ptrOrHandle, (Subtype)uintValue);
return new V8ObjectImpl((V8Object.Handle)ptrOrHandle, (Subtype)uintValue, (Flags)intValue);
case Type.HostObject:
return V8ProxyHelpers.GetHostObject(ptrOrHandle);
@ -1053,7 +1029,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static void SetV8Object(Ptr pV8Value, V8ObjectImpl v8ObjectImpl)
{
V8SplitProxyNative.InvokeNoThrow(instance => instance.V8Value_SetV8Object(pV8Value, v8ObjectImpl.Handle, v8ObjectImpl.Subtype));
V8SplitProxyNative.InvokeNoThrow(instance => instance.V8Value_SetV8Object(pV8Value, v8ObjectImpl.Handle, v8ObjectImpl.Subtype, v8ObjectImpl.Flags));
}
private static void SetHostObject(Ptr pV8Value, object obj)
@ -1082,7 +1058,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
#endregion
#region Nested type: Subtype : ushort
#region Nested type: Subtype
public enum Subtype : ushort
{
@ -1099,22 +1075,33 @@ namespace Microsoft.ClearScript.V8.SplitProxy
Int16Array,
Uint32Array,
Int32Array,
BigUint64Array,
BigInt64Array,
Float32Array,
Float64Array
}
#endregion
#region Nested type: Flags
[Flags]
public enum Flags : ushort
{
// IMPORTANT: maintain bitwise equivalence with native enum V8Value::Flags
None = 0,
Shared = 0x0001
}
#endregion
#region Nested type: Ptr
internal readonly struct Ptr
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -1140,10 +1127,10 @@ namespace Microsoft.ClearScript.V8.SplitProxy
public static void ProcessProfile(V8Entity.Handle hEntity, Ptr pProfile, V8.V8CpuProfile profile)
{
string name = null;
ulong startTimestamp = 0;
ulong endTimestamp = 0;
int sampleCount = 0;
Node.Ptr pRootNode = Node.Ptr.Null;
var startTimestamp = 0UL;
var endTimestamp = 0UL;
var sampleCount = 0;
var pRootNode = Node.Ptr.Null;
V8SplitProxyNative.InvokeNoThrow(instance => instance.V8CpuProfile_GetInfo(pProfile, hEntity, out name, out startTimestamp, out endTimestamp, out sampleCount, out pRootNode));
profile.Name = name;
@ -1161,8 +1148,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
for (var index = 0; index < sampleCount; index++)
{
ulong nodeId = 0;
ulong timestamp = 0;
var nodeId = 0UL;
var timestamp = 0UL;
var sampleIndex = index;
var found = V8SplitProxyNative.InvokeNoThrow(instance => instance.V8CpuProfile_GetSample(pProfile, sampleIndex, out nodeId, out timestamp));
if (found)
@ -1184,16 +1171,16 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static V8.V8CpuProfile.Node CreateNode(V8Entity.Handle hEntity, Node.Ptr pNode)
{
ulong nodeId = 0;
long scriptId = 0;
var nodeId = 0UL;
var scriptId = 0L;
string scriptName = null;
string functionName = null;
string bailoutReason = null;
long lineNumber = 0;
long columnNumber = 0;
ulong hitCount = 0;
uint hitLineCount = 0;
int childCount = 0;
var lineNumber = 0L;
var columnNumber = 0L;
var hitCount = 0UL;
var hitLineCount = 0U;
var childCount = 0;
V8SplitProxyNative.InvokeNoThrow(instance => instance.V8CpuProfileNode_GetInfo(pNode, hEntity, out nodeId, out scriptId, out scriptName, out functionName, out bailoutReason, out lineNumber, out columnNumber, out hitCount, out hitLineCount, out childCount));
var node = new V8.V8CpuProfile.Node
@ -1259,10 +1246,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -1293,10 +1277,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr bits;
private Ptr(IntPtr bits)
{
this.bits = bits;
}
private Ptr(IntPtr bits) => this.bits = bits;
public static readonly Ptr Null = new Ptr(IntPtr.Zero);
@ -1332,10 +1313,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr guts;
private Handle(IntPtr guts)
{
this.guts = guts;
}
private Handle(IntPtr guts) => this.guts = guts;
public static readonly Handle Empty = new Handle(IntPtr.Zero);
@ -1364,10 +1342,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr guts;
private Handle(IntPtr guts)
{
this.guts = guts;
}
private Handle(IntPtr guts) => this.guts = guts;
public static readonly Handle Empty = new Handle(IntPtr.Zero);
@ -1399,10 +1374,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr guts;
private Handle(IntPtr guts)
{
this.guts = guts;
}
private Handle(IntPtr guts) => this.guts = guts;
public static readonly Handle Empty = new Handle(IntPtr.Zero);
@ -1434,10 +1406,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr guts;
private Handle(IntPtr guts)
{
this.guts = guts;
}
private Handle(IntPtr guts) => this.guts = guts;
public static readonly Handle Empty = new Handle(IntPtr.Zero);
@ -1469,10 +1438,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr guts;
private Handle(IntPtr guts)
{
this.guts = guts;
}
private Handle(IntPtr guts) => this.guts = guts;
public static readonly Handle Empty = new Handle(IntPtr.Zero);
@ -1504,10 +1470,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr guts;
private Handle(IntPtr guts)
{
this.guts = guts;
}
private Handle(IntPtr guts) => this.guts = guts;
public static readonly Handle Empty = new Handle(IntPtr.Zero);
@ -1539,10 +1502,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
{
private readonly IntPtr guts;
private Handle(IntPtr guts)
{
this.guts = guts;
}
private Handle(IntPtr guts) => this.guts = guts;
public static readonly Handle Empty = new Handle(IntPtr.Zero);

Просмотреть файл

@ -0,0 +1,228 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Microsoft.ClearScript.V8.SplitProxy
{
internal static partial class V8SplitProxyManaged
{
#region fast method pointers
private readonly struct StdBool
{
private readonly byte bits;
// ReSharper disable once UnusedMember.Local
private StdBool(byte bits) => this.bits = bits;
private static readonly StdBool @false = new(0);
private static readonly StdBool @true = new(1);
public static implicit operator bool(StdBool value) => value.bits != 0;
public static implicit operator StdBool(bool value) => value ? @true : @false;
public static void Write(IntPtr ptr, StdBool value) => Marshal.WriteByte(ptr, value.bits);
}
private static unsafe IntPtr CacheV8ObjectFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pCache, IntPtr pObject, IntPtr pV8Object)
{
CacheV8Object(pCache, pObject, pV8Object);
}
delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr GetCachedV8ObjectFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static IntPtr Thunk(IntPtr pCache, IntPtr pObject)
{
return GetCachedV8Object(pCache, pObject);
}
delegate* unmanaged[Stdcall]<IntPtr, IntPtr, IntPtr> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr AddRefHostObjectFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static IntPtr Thunk(IntPtr pObject)
{
return AddRefHostObject(pObject);
}
delegate* unmanaged[Stdcall]<IntPtr, IntPtr> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr ReleaseHostObjectFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject)
{
ReleaseHostObject(pObject);
}
delegate* unmanaged[Stdcall]<IntPtr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr GetHostObjectInvocabilityFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static Invocability Thunk(IntPtr pObject)
{
return GetHostObjectInvocability(pObject);
}
delegate* unmanaged[Stdcall]<IntPtr, Invocability> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr InvokeHostActionFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pAction)
{
InvokeHostAction(pAction);
}
delegate* unmanaged[Stdcall]<IntPtr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr GetHostObjectNamedPropertyFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject, StdString.Ptr pName, V8Value.Ptr pValue)
{
GetHostObjectNamedProperty(pObject, pName, pValue);
}
delegate* unmanaged[Stdcall]<IntPtr, StdString.Ptr, V8Value.Ptr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr GetHostObjectNamedPropertyWithCacheabilityFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject, StdString.Ptr pName, V8Value.Ptr pValue, IntPtr pIsCacheable)
{
GetHostObjectNamedPropertyWithCacheability(pObject, pName, pValue, out var isCacheable);
StdBool.Write(pIsCacheable, isCacheable);
}
delegate* unmanaged[Stdcall]<IntPtr, StdString.Ptr, V8Value.Ptr, IntPtr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr SetHostObjectNamedPropertyFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject, StdString.Ptr pName, V8Value.Ptr pValue)
{
SetHostObjectNamedProperty(pObject, pName, pValue);
}
delegate* unmanaged[Stdcall]<IntPtr, StdString.Ptr, V8Value.Ptr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr GetHostObjectIndexedPropertyFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject, int index, V8Value.Ptr pValue)
{
GetHostObjectIndexedProperty(pObject, index, pValue);
}
delegate* unmanaged[Stdcall]<IntPtr, int, V8Value.Ptr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr SetHostObjectIndexedPropertyFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject, int index, V8Value.Ptr pValue)
{
SetHostObjectIndexedProperty(pObject, index, pValue);
}
delegate* unmanaged[Stdcall]<IntPtr, int, V8Value.Ptr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr InvokeHostObjectFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject, StdBool asConstructor, StdV8ValueArray.Ptr pArgs, V8Value.Ptr pResult)
{
InvokeHostObject(pObject, asConstructor, pArgs, pResult);
}
delegate* unmanaged[Stdcall]<IntPtr, StdBool, StdV8ValueArray.Ptr, V8Value.Ptr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
private static unsafe IntPtr InvokeHostObjectMethodFastMethodPtr
{
get
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
static void Thunk(IntPtr pObject, StdString.Ptr pName, StdV8ValueArray.Ptr pArgs, V8Value.Ptr pResult)
{
InvokeHostObjectMethod(pObject, pName, pArgs, pResult);
}
delegate* unmanaged[Stdcall]<IntPtr, StdString.Ptr, StdV8ValueArray.Ptr, V8Value.Ptr, void> pThunk = &Thunk;
return (IntPtr)pThunk;
}
}
#endregion
}
}

Просмотреть файл

@ -12,7 +12,8 @@ using Microsoft.ClearScript.Util;
namespace Microsoft.ClearScript.V8.SplitProxy
{
internal static class V8SplitProxyManaged
// ReSharper disable once PartialTypeWithSinglePart
internal static partial class V8SplitProxyManaged
{
public static IntPtr MethodTable { get; } = CreateMethodTable();
@ -35,6 +36,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
#region method delegates
// ReSharper disable UnusedType.Local
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void RawScheduleForwardingException(
[In] V8Value.Ptr pException
@ -299,6 +302,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[return: MarshalAs(UnmanagedType.I1)]
private delegate bool RawGetTopLevelAwait();
// ReSharper restore UnusedType.Local
#endregion
#region method table construction
@ -315,12 +320,25 @@ namespace Microsoft.ClearScript.V8.SplitProxy
GetMethodPtr<RawScheduleInvalidOperationException>(ScheduleInvalidOperationException),
GetMethodPtr<RawScheduleScriptEngineException>(ScheduleScriptEngineException),
GetMethodPtr<RawScheduleScriptInterruptedException>(ScheduleScriptInterruptedException),
#if NET5_0_OR_GREATER
InvokeHostActionFastMethodPtr,
#else
GetMethodPtr<RawInvokeAction>(InvokeHostAction),
#endif
GetMethodPtr<RawProcessArrayBufferOrViewData>(ProcessArrayBufferOrViewData),
GetMethodPtr<RawProcessCpuProfile>(ProcessCpuProfile),
GetMethodPtr<RawCreateV8ObjectCache>(CreateV8ObjectCache),
#if NET5_0_OR_GREATER
CacheV8ObjectFastMethodPtr,
GetCachedV8ObjectFastMethodPtr,
#else
GetMethodPtr<RawCacheV8Object>(CacheV8Object),
GetMethodPtr<RawGetCachedV8Object>(GetCachedV8Object),
#endif
GetMethodPtr<RawGetAllCachedV8Objects>(GetAllCachedV8Objects),
GetMethodPtr<RawRemoveV8ObjectCacheEntry>(RemoveV8ObjectCacheEntry),
GetMethodPtr<RawCreateDebugAgent>(CreateDebugAgent),
@ -328,20 +346,49 @@ namespace Microsoft.ClearScript.V8.SplitProxy
GetMethodPtr<RawDestroyDebugAgent>(DestroyDebugAgent),
GetMethodPtr<RawGetMaxScriptCacheSize>(GetMaxScriptCacheSize),
GetMethodPtr<RawGetMaxModuleCacheSize>(GetMaxModuleCacheSize),
#if NET5_0_OR_GREATER
AddRefHostObjectFastMethodPtr,
ReleaseHostObjectFastMethodPtr,
GetHostObjectInvocabilityFastMethodPtr,
#else
GetMethodPtr<RawAddRefHostObject>(AddRefHostObject),
GetMethodPtr<RawReleaseHostObject>(ReleaseHostObject),
GetMethodPtr<RawGetHostObjectInvocability>(GetHostObjectInvocability),
#endif
#if NET5_0_OR_GREATER
GetHostObjectNamedPropertyFastMethodPtr,
GetHostObjectNamedPropertyWithCacheabilityFastMethodPtr,
SetHostObjectNamedPropertyFastMethodPtr,
#else
GetMethodPtr<RawGetHostObjectNamedProperty>(GetHostObjectNamedProperty),
GetMethodPtr<RawGetHostObjectNamedPropertyWithCacheability>(GetHostObjectNamedPropertyWithCacheability),
GetMethodPtr<RawSetHostObjectNamedProperty>(SetHostObjectNamedProperty),
#endif
GetMethodPtr<RawDeleteHostObjectNamedProperty>(DeleteHostObjectNamedProperty),
GetMethodPtr<RawGetHostObjectPropertyNames>(GetHostObjectPropertyNames),
#if NET5_0_OR_GREATER
GetHostObjectIndexedPropertyFastMethodPtr,
SetHostObjectIndexedPropertyFastMethodPtr,
#else
GetMethodPtr<RawGetHostObjectIndexedProperty>(GetHostObjectIndexedProperty),
GetMethodPtr<RawSetHostObjectIndexedProperty>(SetHostObjectIndexedProperty),
#endif
GetMethodPtr<RawDeleteHostObjectIndexedProperty>(DeleteHostObjectIndexedProperty),
GetMethodPtr<RawGetHostObjectPropertyIndices>(GetHostObjectPropertyIndices),
#if NET5_0_OR_GREATER
InvokeHostObjectFastMethodPtr,
InvokeHostObjectMethodFastMethodPtr,
#else
GetMethodPtr<RawInvokeHostObject>(InvokeHostObject),
GetMethodPtr<RawInvokeHostObjectMethod>(InvokeHostObjectMethod),
#endif
GetMethodPtr<RawGetHostObjectEnumerator>(GetHostObjectEnumerator),
GetMethodPtr<RawGetHostObjectAsyncEnumerator>(GetHostObjectAsyncEnumerator),
GetMethodPtr<RawQueueNativeCallback>(QueueNativeCallback),

Просмотреть файл

@ -363,9 +363,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -493,6 +493,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -666,6 +671,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -1347,7 +1357,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)]
@ -1491,6 +1502,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -1654,6 +1670,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,

Просмотреть файл

@ -405,9 +405,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -535,6 +535,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -708,6 +713,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -1389,7 +1399,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
@ -1533,6 +1544,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -1696,6 +1712,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -2314,9 +2335,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -2444,6 +2465,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -2617,6 +2643,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -3298,7 +3329,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
@ -3442,6 +3474,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -3605,6 +3642,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -4223,9 +4265,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -4353,6 +4395,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -4526,6 +4573,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -5207,7 +5259,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
@ -5351,6 +5404,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -5514,6 +5572,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -6132,9 +6195,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -6262,6 +6325,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -6435,6 +6503,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -7116,7 +7189,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)]
@ -7260,6 +7334,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -7423,6 +7502,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -8041,9 +8125,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -8171,6 +8255,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -8344,6 +8433,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -9025,7 +9119,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)]
@ -9169,6 +9264,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -9332,6 +9432,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -9950,9 +10055,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -10080,6 +10185,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -10253,6 +10363,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -10934,7 +11049,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)]
@ -11078,6 +11194,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -11241,6 +11362,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -11859,9 +11985,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -11989,6 +12115,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -12162,6 +12293,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -12843,7 +12979,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)]
@ -12987,6 +13124,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -13150,6 +13292,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -13768,9 +13915,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -13898,6 +14045,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -14071,6 +14223,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -14752,7 +14909,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)]
@ -14896,6 +15054,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -15059,6 +15222,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,

Просмотреть файл

@ -361,9 +361,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -491,6 +491,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -664,6 +669,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -1345,7 +1355,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
@ -1489,6 +1500,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -1652,6 +1668,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -2270,9 +2291,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -2400,6 +2421,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -2573,6 +2599,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -3254,7 +3285,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
@ -3398,6 +3430,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -3561,6 +3598,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,
@ -4179,9 +4221,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Value_SetBigInt(pV8Value, signBit, bytes, bytes.Length);
}
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype)
void IV8SplitProxyNative.V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags)
{
V8Value_SetV8Object(pV8Value, hObject, subtype);
V8Value_SetV8Object(pV8Value, hObject, subtype, flags);
}
void IV8SplitProxyNative.V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject)
@ -4309,6 +4351,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Isolate_AwaitDebuggerAndPause(hIsolate);
}
void IV8SplitProxyNative.V8Isolate_CancelAwaitDebugger(V8Isolate.Handle hIsolate)
{
V8Isolate_CancelAwaitDebugger(hIsolate);
}
V8Script.Handle IV8SplitProxyNative.V8Isolate_Compile(V8Isolate.Handle hIsolate, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -4482,6 +4529,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
V8Context_AwaitDebuggerAndPause(hContext);
}
void IV8SplitProxyNative.V8Context_CancelAwaitDebugger(V8Context.Handle hContext)
{
V8Context_CancelAwaitDebugger(hContext);
}
object IV8SplitProxyNative.V8Context_ExecuteCode(V8Context.Handle hContext, string resourceName, string sourceMapUrl, ulong uniqueId, bool isModule, IntPtr pDocumentInfo, string code, bool evaluate)
{
using (var resourceNameScope = StdString.CreateScope(resourceName))
@ -5163,7 +5215,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
private static extern void V8Value_SetV8Object(
[In] V8Value.Ptr pV8Value,
[In] V8Object.Handle hObject,
[In] V8Value.Subtype subtype
[In] V8Value.Subtype subtype,
[In] V8Value.Flags flags
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
@ -5307,6 +5360,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Isolate_CancelAwaitDebugger(
[In] V8Isolate.Handle hIsolate
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern V8Script.Handle V8Isolate_Compile(
[In] V8Isolate.Handle hIsolate,
@ -5470,6 +5528,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_CancelAwaitDebugger(
[In] V8Context.Handle hContext
);
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
private static extern void V8Context_ExecuteCode(
[In] V8Context.Handle hContext,

Просмотреть файл

@ -15,6 +15,8 @@ namespace Microsoft.ClearScript.V8
Int16Array,
Uint32Array,
Int32Array,
BigUint64Array,
BigInt64Array,
Float32Array,
Float64Array
}

Просмотреть файл

@ -28,6 +28,8 @@ namespace Microsoft.ClearScript.V8
public abstract void AwaitDebuggerAndPause();
public abstract void CancelAwaitDebugger();
public abstract object Execute(UniqueDocumentInfo documentInfo, string code, bool evaluate);
public abstract V8Script Compile(UniqueDocumentInfo documentInfo, string code);

Просмотреть файл

@ -22,6 +22,8 @@ namespace Microsoft.ClearScript.V8
public abstract void AwaitDebuggerAndPause();
public abstract void CancelAwaitDebugger();
public abstract V8Script Compile(UniqueDocumentInfo documentInfo, string code);
public abstract V8Script Compile(UniqueDocumentInfo documentInfo, string code, V8CacheKind cacheKind, out byte[] cacheBytes);

Просмотреть файл

@ -33,6 +33,9 @@ namespace Microsoft.ClearScript.V8
private static readonly DocumentInfo initScriptInfo = new DocumentInfo(MiscHelpers.FormatInvariant("{0} [internal]", nameof(V8ScriptEngine)));
private readonly V8Runtime runtime;
private readonly bool usingPrivateRuntime;
private readonly V8ScriptEngineFlags engineFlags;
private readonly V8ContextProxy proxy;
private readonly object script;
@ -211,164 +214,165 @@ namespace Microsoft.ClearScript.V8
internal V8ScriptEngine(V8Runtime runtime, string name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, int debugPort)
: base((runtime != null) ? runtime.Name + ":" + name : name, "js")
{
var localRuntime = (runtime != null) ? null : new V8Runtime(name, constraints);
using (localRuntime)
if (runtime != null)
{
var activeRuntime = runtime ?? localRuntime;
DocumentNameManager = activeRuntime.DocumentNameManager;
HostItemCollateral = activeRuntime.HostItemCollateral;
engineFlags = flags;
proxy = V8ContextProxy.Create(activeRuntime.IsolateProxy, Name, flags, debugPort);
script = GetRootItem();
Execute(initScriptInfo,
@"
Object.defineProperty(this, 'EngineInternal', { value: (function () {
function convertArgs(args) {
let result = [];
let count = args.Length;
for (let i = 0; i < count; i++) {
result.push(args[i]);
}
return result;
}
function construct() {
return new this(...arguments);
}
const isHostObjectKey = this.isHostObjectKey;
delete this.isHostObjectKey;
const savedPromise = Promise;
return Object.freeze({
commandHolder: {
},
getCommandResult: function (value) {
if (value == null) {
return value;
}
if (typeof(value.hasOwnProperty) != 'function') {
if (value[Symbol.toStringTag] == 'Module') {
return '[module]';
}
return '[external]';
}
if (value[isHostObjectKey] === true) {
return value;
}
if (typeof(value.toString) != 'function') {
return '[' + typeof(value) + ']';
}
return value.toString();
},
invokeConstructor: function (constructor, args) {
if (typeof(constructor) != 'function') {
throw new Error('Function expected');
}
return construct.apply(constructor, convertArgs(args));
},
invokeMethod: function (target, method, args) {
if (typeof(method) != 'function') {
throw new Error('Function expected');
}
return method.apply(target, convertArgs(args));
},
createPromise: function () {
return new savedPromise(...arguments);
},
isPromise: function (value) {
return value instanceof savedPromise;
},
completePromiseWithResult: function (getResult, resolve, reject) {
try {
resolve(getResult());
}
catch (exception) {
reject(exception);
}
return undefined;
},
completePromise: function (wait, resolve, reject) {
try {
wait();
resolve();
}
catch (exception) {
reject(exception);
}
return undefined;
},
throwValue: function (value) {
throw value;
},
getStackTrace: function () {
try {
throw new Error('[stack trace]');
}
catch (exception) {
return exception.stack;
}
return '';
},
toIterator: function* (enumerator) {
while (enumerator.MoveNext()) {
yield enumerator.Current;
}
},
toAsyncIterator: async function* (asyncEnumerator) {
while (await asyncEnumerator.MoveNextPromise()) {
yield asyncEnumerator.Current;
}
}
});
})() });
"
);
if (flags.HasFlag(V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart))
{
awaitDebuggerAndPause = true;
}
this.runtime = runtime;
}
else
{
this.runtime = runtime = new V8Runtime(name, constraints);
usingPrivateRuntime = true;
}
// The above code appears to be problematic on some .NET runtimes, intermittently
// triggering premature finalization of the V8 isolate proxy. That can lead to a crash
// if the proxy's finalizer ends up racing against its Dispose method. The call below
// should prevent this condition in all cases.
//
// UPDATE: The observed behavior is actually documented. As Dispose is invoked via
// the proxy's only reference, the proxy may become eligible for finalization during
// the call. Typically Dispose invokes GC.SuppressFinalize just before exiting, which,
// in addition to canceling finalization, extends the object's lifetime until Dispose
// has done its job. The proxy here is unusual in that it requires finalization
// regardless of disposal, so the correct fix is for Dispose to invoke GC.KeepAlive as
// its final step. The original fix is retained here for regression avoidance.
DocumentNameManager = runtime.DocumentNameManager;
HostItemCollateral = runtime.HostItemCollateral;
GC.KeepAlive(localRuntime);
engineFlags = flags;
proxy = V8ContextProxy.Create(runtime.IsolateProxy, Name, flags, debugPort);
script = GetRootItem();
Execute(initScriptInfo,
@"
Object.defineProperty(this, 'EngineInternal', { value: (function () {
function convertArgs(args) {
let result = [];
let count = args.Length;
for (let i = 0; i < count; i++) {
result.push(args[i]);
}
return result;
}
function construct() {
return new this(...arguments);
}
const isHostObjectKey = this.isHostObjectKey;
delete this.isHostObjectKey;
const savedPromise = Promise;
return Object.freeze({
commandHolder: {
},
getCommandResult: function (value) {
if (value == null) {
return value;
}
if (typeof(value.hasOwnProperty) != 'function') {
if (value[Symbol.toStringTag] == 'Module') {
return '[module]';
}
return '[external]';
}
if (value[isHostObjectKey] === true) {
return value;
}
if (typeof(value.toString) != 'function') {
return '[' + typeof(value) + ']';
}
return value.toString();
},
invokeConstructor: function (constructor, args) {
if (typeof(constructor) != 'function') {
throw new Error('Function expected');
}
return construct.apply(constructor, convertArgs(args));
},
invokeMethod: function (target, method, args) {
if (typeof(method) != 'function') {
throw new Error('Function expected');
}
return method.apply(target, convertArgs(args));
},
createPromise: function () {
return new savedPromise(...arguments);
},
isPromise: function (value) {
return value instanceof savedPromise;
},
completePromiseWithResult: function (getResult, resolve, reject) {
try {
resolve(getResult());
}
catch (exception) {
reject(exception);
}
return undefined;
},
completePromise: function (wait, resolve, reject) {
try {
wait();
resolve();
}
catch (exception) {
reject(exception);
}
return undefined;
},
throwValue: function (value) {
throw value;
},
getStackTrace: function () {
try {
throw new Error('[stack trace]');
}
catch (exception) {
return exception.stack;
}
return '';
},
toIterator: function* (enumerator) {
while (enumerator.MoveNext()) {
yield enumerator.Current;
}
},
toAsyncIterator: async function* (asyncEnumerator) {
while (await asyncEnumerator.MoveNextPromise()) {
yield asyncEnumerator.Current;
}
}
});
})() });
"
);
if (flags.HasFlag(V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart))
{
awaitDebuggerAndPause = true;
}
}
#endregion
#region public members
/// <summary>
/// Resumes script execution if the script engine is waiting for a debugger connection.
/// </summary>
/// <remarks>
/// This method can be called safely from any thread.
/// </remarks>
public void CancelAwaitDebugger()
{
VerifyNotDisposed();
proxy.CancelAwaitDebugger();
}
/// <summary>
/// Gets or sets a soft limit for the size of the V8 runtime's heap.
/// </summary>
@ -1325,7 +1329,7 @@ namespace Microsoft.ClearScript.V8
return obj;
}
if (obj.GetType().IsGuidType<TypeGuidMocks.Nothing>())
if (obj is INothingTag)
{
return null;
}
@ -1411,7 +1415,12 @@ namespace Microsoft.ClearScript.V8
if (obj is ScriptItem scriptItem)
{
if (scriptItem.Engine == this)
if ((scriptItem.Engine is V8ScriptEngine that) && (that.runtime == runtime))
{
return scriptItem.Unwrap();
}
if ((scriptItem is V8ScriptItem v8ScriptItem) && v8ScriptItem.IsShared)
{
return scriptItem.Unwrap();
}
@ -1453,7 +1462,7 @@ namespace Microsoft.ClearScript.V8
}
var scriptItem = V8ScriptItem.Wrap(this, obj);
if (engineFlags.HasFlag(V8ScriptEngineFlags.EnableTaskPromiseConversion) && (obj is IV8Object v8Object) && v8Object.IsPromise())
if (engineFlags.HasFlag(V8ScriptEngineFlags.EnableTaskPromiseConversion) && (obj is IV8Object v8Object) && v8Object.IsPromise)
{
return scriptItem.ToTask();
}
@ -1565,8 +1574,14 @@ namespace Microsoft.ClearScript.V8
if (disposedFlag.Set())
{
base.Dispose(true);
((IDisposable)script).Dispose();
proxy.Dispose();
if (usingPrivateRuntime)
{
runtime.Dispose();
}
}
}
else
@ -1599,7 +1614,7 @@ namespace Microsoft.ClearScript.V8
Task<object> IJavaScriptEngine.CreateTaskForPromise(ScriptObject promise)
{
if (!(promise is V8ScriptItem v8Promise) || !v8Promise.IsPromise())
if (!(promise is V8ScriptItem v8ScriptItem) || !v8ScriptItem.IsPromise)
{
throw new ArgumentException("The object is not a V8 promise", nameof(promise));
}
@ -1623,7 +1638,7 @@ namespace Microsoft.ClearScript.V8
}
};
v8Promise.InvokeMethod(false, "then", onResolved, onRejected);
v8ScriptItem.InvokeMethod(false, "then", onResolved, onRejected);
return source.Task;
}

Просмотреть файл

@ -35,12 +35,12 @@ namespace Microsoft.ClearScript.V8
if (obj is IV8Object target)
{
if (target.IsArray())
if (target.IsArray)
{
return new V8Array(engine, target);
}
if (!target.IsArrayBufferOrView())
if (!target.IsArrayBufferOrView)
{
return new V8ScriptItem(engine, target);
}
@ -64,6 +64,10 @@ namespace Microsoft.ClearScript.V8
return new V8TypedArray<uint>(engine, target);
case V8ArrayBufferOrViewKind.Int32Array:
return new V8TypedArray<int>(engine, target);
case V8ArrayBufferOrViewKind.BigUint64Array:
return new V8TypedArray<ulong>(engine, target);
case V8ArrayBufferOrViewKind.BigInt64Array:
return new V8TypedArray<long>(engine, target);
case V8ArrayBufferOrViewKind.Float32Array:
return new V8TypedArray<float>(engine, target);
case V8ArrayBufferOrViewKind.Float64Array:
@ -76,10 +80,9 @@ namespace Microsoft.ClearScript.V8
return obj;
}
public bool IsPromise()
{
return target.IsPromise();
}
public bool IsPromise => target.IsPromise;
public bool IsShared => target.IsShared;
public object InvokeMethod(bool marshalResult, string name, params object[] args)
{

Просмотреть файл

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.ClearScript.Util;
namespace Microsoft.ClearScript.Windows.Core
@ -15,8 +14,7 @@ namespace Microsoft.ClearScript.Windows.Core
/// This class can be used in non-desktop environments such as server applications. An
/// implementation of <see cref="ISyncInvoker"/> is required to enforce thread affinity.
/// </remarks>
[Guid(TypeGuids.VBScriptEngine)]
public class VBScriptEngine : WindowsScriptEngine
public class VBScriptEngine : WindowsScriptEngine, IVBScriptEngineTag
{
#region data

Просмотреть файл

@ -13,8 +13,7 @@ using Microsoft.ClearScript.Util.COM;
namespace Microsoft.ClearScript.Windows.Core
{
[Guid(TypeGuids.WindowsScriptItem)]
internal sealed class WindowsScriptItem : ScriptItem, IWindowsScriptObject, IDisposable
internal sealed class WindowsScriptItem : ScriptItem, IWindowsScriptObject, IDisposable, IWindowsScriptItemTag
{
private readonly WindowsScriptEngine engine;
private readonly IDispatchEx target;

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.Runtime.InteropServices;
using Microsoft.ClearScript.Util;
namespace Microsoft.ClearScript.Windows
@ -17,8 +16,7 @@ namespace Microsoft.ClearScript.Windows
/// In JScript it appears as a value that is equal to, but not strictly equal to,
/// <c><see href="https://developer.mozilla.org/en-US/docs/Glossary/Undefined">undefined</see></c>.
/// </remarks>
[Guid(TypeGuids.Nothing)]
public class Nothing
public class Nothing : INothingTag
{
/// <summary>
/// The sole instance of the <see cref="Nothing"/> class.

Просмотреть файл

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.ClearScript.Util;
namespace Microsoft.ClearScript.Windows
@ -17,8 +16,7 @@ namespace Microsoft.ClearScript.Windows
/// Attempting to execute script code on a different thread results in an exception. Script
/// delegates and event handlers are marshaled synchronously onto the correct thread.
/// </remarks>
[Guid(TypeGuids.VBScriptEngine)]
public class VBScriptEngine : WindowsScriptEngine
public class VBScriptEngine : WindowsScriptEngine, IVBScriptEngineTag
{
#region constructors

Двоичные данные
ClearScript/doc/Build.docx

Двоичный файл не отображается.

Двоичные данные
ClearScript/doc/Reference.chm

Двоичный файл не отображается.

Просмотреть файл

@ -11,6 +11,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.7")]
[assembly: AssemblyFileVersion("7.1.7")]
[assembly: AssemblyInformationalVersion("7.1.7")]
[assembly: AssemblyVersion("7.2.0")]
[assembly: AssemblyFileVersion("7.2.0")]
[assembly: AssemblyInformationalVersion("7.2.0")]

Просмотреть файл

@ -11,6 +11,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.7")]
[assembly: AssemblyFileVersion("7.1.7")]
[assembly: AssemblyInformationalVersion("7.1.7")]
[assembly: AssemblyVersion("7.2.0")]
[assembly: AssemblyFileVersion("7.2.0")]
[assembly: AssemblyInformationalVersion("7.2.0")]

Просмотреть файл

@ -1026,7 +1026,7 @@ namespace Microsoft.ClearScript.Test
engine = new VBScriptEngine(WindowsScriptEngineFlags.EnableDebugging);
var recordSet = new ADODB.Recordset();
recordSet.Fields.Append("foo", ADODB.DataTypeEnum.adVarChar, 20);
recordSet.Fields._Append("foo", ADODB.DataTypeEnum.adVarChar, 20);
recordSet.Open(Missing.Value, Missing.Value, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic, 0);
recordSet.AddNew(Missing.Value, Missing.Value);
recordSet.Fields["foo"].Value = "bar";

Просмотреть файл

@ -1509,20 +1509,20 @@ namespace Microsoft.ClearScript.Test
[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.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 = 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]);
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

Просмотреть файл

@ -11,6 +11,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.7")]
[assembly: AssemblyFileVersion("7.1.7")]
[assembly: AssemblyInformationalVersion("7.1.7")]
[assembly: AssemblyVersion("7.2.0")]
[assembly: AssemblyFileVersion("7.2.0")]
[assembly: AssemblyInformationalVersion("7.2.0")]

Просмотреть файл

@ -1384,6 +1384,310 @@ namespace Microsoft.ClearScript.Test
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<int>)engine.Script.typedArray).Write(testValues, 16384, 512, 0));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigUint64Array()
{
var typedArray = (ITypedArray<ulong>)engine.Evaluate("new BigUint64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(123456UL, typedArray.ArrayBuffer.Size);
Assert.AreEqual(128UL, typedArray.Offset);
Assert.AreEqual(8192UL, typedArray.Size);
Assert.AreEqual(1024UL, typedArray.Length);
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigUint64Array_GetBytes()
{
engine.Execute(@"
typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).SelectMany(index => BitConverter.GetBytes((ulong)index)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<ulong>)engine.Script.typedArray).GetBytes()));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<ulong>)engine.Script.typedArray).GetBytes()));
}
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigUint64Array_ReadBytes()
{
engine.Execute(@"
typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).SelectMany(index => BitConverter.GetBytes((ulong)index)).ToArray();
var readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).ReadBytes(16384, 1024, readValues, 0));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).ReadBytes(0, 1024, readValues, 16384));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigUint64Array_WriteBytes()
{
var testValues = Enumerable.Range(0, 64).SelectMany(index => BitConverter.GetBytes((ulong)index)).ToArray();
engine.Execute("typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).WriteBytes(testValues, 256, 16384, 128));
var readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
engine.Execute("typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).WriteBytes(testValues, 256, 16384, 128));
readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).WriteBytes(testValues, 0, 512, 16384));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).WriteBytes(testValues, 16384, 512, 0));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigUint64Array_ToArray()
{
engine.Execute(@"
typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).Select(index => (ulong)index).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<ulong>)engine.Script.typedArray).ToArray()));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<ulong>)engine.Script.typedArray).ToArray()));
}
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigUint64Array_Read()
{
engine.Execute(@"
typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).Select(index => (ulong)index).ToArray();
var readValues = new ulong[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
readValues = new ulong[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).Read(16384, 1024, readValues, 0));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).Read(0, 1024, readValues, 16384));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigUint64Array_Write()
{
var testValues = Enumerable.Range(0, 512).Select(index => (ulong)index).ToArray();
engine.Execute("typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).Write(testValues, 256, 16384, 128));
var readValues = new ulong[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
engine.Execute("typedArray = new BigUint64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).Write(testValues, 256, 16384, 128));
readValues = new ulong[512];
Assert.AreEqual(256UL, ((ITypedArray<ulong>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).Write(testValues, 0, 512, 16384));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<ulong>)engine.Script.typedArray).Write(testValues, 16384, 512, 0));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigInt64Array()
{
var typedArray = (ITypedArray<long>)engine.Evaluate("new BigInt64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(123456UL, typedArray.ArrayBuffer.Size);
Assert.AreEqual(128UL, typedArray.Offset);
Assert.AreEqual(8192UL, typedArray.Size);
Assert.AreEqual(1024UL, typedArray.Length);
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigInt64Array_GetBytes()
{
engine.Execute(@"
typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).SelectMany(index => BitConverter.GetBytes((long)index)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<long>)engine.Script.typedArray).GetBytes()));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<long>)engine.Script.typedArray).GetBytes()));
}
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigInt64Array_ReadBytes()
{
engine.Execute(@"
typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).SelectMany(index => BitConverter.GetBytes((long)index)).ToArray();
var readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).ReadBytes(16384, 1024, readValues, 0));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).ReadBytes(0, 1024, readValues, 16384));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigInt64Array_WriteBytes()
{
var testValues = Enumerable.Range(0, 64).SelectMany(index => BitConverter.GetBytes((long)index)).ToArray();
engine.Execute("typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).WriteBytes(testValues, 256, 16384, 128));
var readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
engine.Execute("typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).WriteBytes(testValues, 256, 16384, 128));
readValues = new byte[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).ReadBytes(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).WriteBytes(testValues, 0, 512, 16384));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).WriteBytes(testValues, 16384, 512, 0));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigInt64Array_ToArray()
{
engine.Execute(@"
typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).Select(index => (long)index).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<long>)engine.Script.typedArray).ToArray()));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<long>)engine.Script.typedArray).ToArray()));
}
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigInt64Array_Read()
{
engine.Execute(@"
typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024);
for (var i = 0; i < 1024; i++) {
typedArray[i] = BigInt(i);
}
");
var testValues = Enumerable.Range(0, 1024).Select(index => (long)index).ToArray();
var readValues = new long[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
readValues = new long[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(128).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).Read(16384, 1024, readValues, 0));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).Read(0, 1024, readValues, 16384));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_BigInt64Array_Write()
{
var testValues = Enumerable.Range(0, 512).Select(index => (long)index).ToArray();
engine.Execute("typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).Write(testValues, 256, 16384, 128));
var readValues = new long[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
using (Scope.Create(() => MiscHelpers.Exchange(ref UnmanagedMemoryHelpers.DisableMarshalCopy, true), value => UnmanagedMemoryHelpers.DisableMarshalCopy = value))
{
engine.Execute("typedArray = new BigInt64Array(new ArrayBuffer(123456), 128, 1024)");
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).Write(testValues, 256, 16384, 128));
readValues = new long[512];
Assert.AreEqual(256UL, ((ITypedArray<long>)engine.Script.typedArray).Read(128, 16384, readValues, 256));
Assert.IsTrue(testValues.Skip(256).Take(256).SequenceEqual(readValues.Skip(256)));
}
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).Write(testValues, 0, 512, 16384));
TestUtil.AssertException<ArgumentOutOfRangeException>(() => ((ITypedArray<long>)engine.Script.typedArray).Write(testValues, 16384, 512, 0));
}
[TestMethod, TestCategory("V8ArrayBufferOrView")]
public void V8ArrayBufferOrView_Float32Array()
{

Просмотреть файл

@ -3283,6 +3283,64 @@ namespace Microsoft.ClearScript.Test
Assert.AreEqual("123,456.75", engine.Evaluate("StringT.Format('{0:###,###.00}', 123456.75)"));
}
[TestMethod, TestCategory("V8ScriptEngine")]
public void V8ScriptEngine_CancelAwaitDebugger()
{
engine.Dispose();
engine = new V8ScriptEngine(V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart);
ThreadPool.QueueUserWorkItem(state =>
{
Thread.Sleep(1000);
engine.CancelAwaitDebugger();
});
engine.Execute("foo = Math.E * Math.PI");
Assert.AreEqual(Math.E * Math.PI, engine.Script.foo);
Assert.AreEqual(Math.Sqrt(Math.E * Math.PI), engine.Evaluate("Math.sqrt(Math.E * Math.PI)"));
}
[TestMethod, TestCategory("V8ScriptEngine")]
public void V8ScriptEngine_ForeignScriptObject_DirectAccess()
{
using (var runtime = new V8Runtime())
{
using (var foreignEngine = runtime.CreateScriptEngine())
{
engine.Script.foreignFunction = foreignEngine.Script.Function;
Assert.AreEqual("object", engine.Evaluate("typeof foreignFunction"));
Assert.AreEqual("function Function() { [native code] }", engine.Evaluate("foreignFunction.toString()"));
engine.Dispose();
engine = runtime.CreateScriptEngine();
engine.Script.foreignFunction = foreignEngine.Script.Function;
Assert.AreEqual("function", engine.Evaluate("typeof foreignFunction"));
Assert.AreEqual("function Function() { [native code] }", engine.Evaluate("foreignFunction.toString()"));
}
}
}
[TestMethod, TestCategory("V8ScriptEngine")]
public void V8ScriptEngine_ForeignScriptObject_DirectAccess_DisposedEngine()
{
using (var runtime = new V8Runtime())
{
object function;
using (var foreignEngine = runtime.CreateScriptEngine())
{
function = foreignEngine.Script.Function;
}
engine.Dispose();
engine = runtime.CreateScriptEngine();
engine.Script.foreignFunction = function;
Assert.AreEqual("function", engine.Evaluate("typeof foreignFunction"));
Assert.AreEqual("function Function() { [native code] }", engine.Evaluate("foreignFunction.toString()"));
}
}
// ReSharper restore InconsistentNaming
#endregion

Просмотреть файл

@ -0,0 +1,183 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Microsoft.ClearScript.JavaScript;
using Microsoft.ClearScript.V8;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.ClearScript.Test
{
[TestClass]
[SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", Justification = "Test classes use TestCleanupAttribute for deterministic teardown.")]
public class V8SharedObjectTest : ClearScriptTest
{
#region setup / teardown
private V8ScriptEngine engine;
private V8ScriptEngine otherEngine;
[TestInitialize]
public void TestInitialize()
{
otherEngine = new V8ScriptEngine();
otherEngine.Execute(@"
arrayBuffer = new SharedArrayBuffer(1024);
array = new Uint8Array(arrayBuffer);
for (let index = 0; index < 1024; ++index) {
array[index] = index & 0xFF;
}
");
engine = new V8ScriptEngine(V8ScriptEngineFlags.EnableDebugging);
engine.Script.arrayBuffer = otherEngine.Script.arrayBuffer;
}
[TestCleanup]
public void TestCleanup()
{
otherEngine.Dispose();
engine.Dispose();
BaseTestCleanup();
}
#endregion
#region test methods
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_ArrayBuffer()
{
Assert.AreEqual("[object SharedArrayBuffer]", engine.ExecuteCommand("arrayBuffer"));
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("arrayBuffer instanceof SharedArrayBuffer")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((IArrayBuffer)engine.Script.arrayBuffer).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_DataView()
{
otherEngine.Execute("dataView = new DataView(arrayBuffer)");
engine.Script.dataView = otherEngine.Script.dataView;
Assert.AreEqual("[object DataView]", engine.ExecuteCommand("dataView"));
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("dataView instanceof DataView")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((IDataView)engine.Script.dataView).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Uint8Array()
{
otherEngine.Execute("array = new Uint8Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Uint8Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<byte>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Uint8ClampedArray()
{
otherEngine.Execute("array = new Uint8ClampedArray(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Uint8ClampedArray")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<byte>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Int8Array()
{
otherEngine.Execute("array = new Int8Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Int8Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<sbyte>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Uint16Array()
{
otherEngine.Execute("array = new Uint16Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Uint16Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<ushort>)engine.Script.array).GetBytes()));
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<char>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Int16Array()
{
otherEngine.Execute("array = new Int16Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Int16Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<short>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Uint32Array()
{
otherEngine.Execute("array = new Uint32Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Uint32Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<uint>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Int32Array()
{
otherEngine.Execute("array = new Int32Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Int32Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<int>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_BigUint64Array()
{
otherEngine.Execute("array = new BigUint64Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof BigUint64Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<ulong>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_BigInt64Array()
{
otherEngine.Execute("array = new BigInt64Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof BigInt64Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<long>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Float32Array()
{
otherEngine.Execute("array = new Float32Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Float32Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<float>)engine.Script.array).GetBytes()));
}
[TestMethod, TestCategory("V8SharedObject")]
public void V8SharedObject_Float64Array()
{
otherEngine.Execute("array = new Float64Array(arrayBuffer)");
engine.Script.array = otherEngine.Script.array;
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("array instanceof Float64Array")));
var testValues = Enumerable.Range(0, 1024).Select(index => Convert.ToByte(index & 0xFF)).ToArray();
Assert.IsTrue(testValues.SequenceEqual(((ITypedArray<double>)engine.Script.array).GetBytes()));
}
#endregion
}
}

Просмотреть файл

@ -94,6 +94,15 @@
// global helper functions
//-----------------------------------------------------------------------------
template <typename TFlag>
inline bool HasFlag(TFlag mask, TFlag flag)
{
using TUnderlying = std::underlying_type_t<TFlag>;
return (static_cast<TUnderlying>(mask) & static_cast<TUnderlying>(flag)) != 0;
}
//-----------------------------------------------------------------------------
template <typename TFlag>
inline TFlag CombineFlags(TFlag flag1, TFlag flag2)
{

Просмотреть файл

@ -41,7 +41,7 @@ public:
V8Value value(V8Value::Nonexistent);
StdBool tempIsCacheable;
V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(GetHostObjectNamedPropertyWithCacheability, pvObject, name, value, tempIsCacheable);
isCacheable = tempIsCacheable;
isCacheable = (tempIsCacheable != 0);
return value;
}

Просмотреть файл

@ -17,3 +17,4 @@
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <optional>

Просмотреть файл

@ -46,8 +46,9 @@ public:
virtual void SetGlobalProperty(const StdString& name, const V8Value& value, bool globalMembers) = 0;
virtual void AwaitDebuggerAndPause() = 0;
virtual V8Value Execute(const V8DocumentInfo& documentInfo, const StdString& code, bool evaluate) = 0;
virtual void CancelAwaitDebugger() = 0;
virtual V8Value Execute(const V8DocumentInfo& documentInfo, const StdString& code, bool evaluate) = 0;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code) = 0;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, std::vector<uint8_t>& cacheBytes) = 0;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, const std::vector<uint8_t>& cacheBytes, bool& cacheAccepted) = 0;

Просмотреть файл

@ -455,6 +455,13 @@ void V8ContextImpl::AwaitDebuggerAndPause()
//-----------------------------------------------------------------------------
void V8ContextImpl::CancelAwaitDebugger()
{
m_spIsolateImpl->CancelAwaitDebugger();
}
//-----------------------------------------------------------------------------
V8Value V8ContextImpl::Execute(const V8DocumentInfo& documentInfo, const StdString& code, bool evaluate)
{
BEGIN_CONTEXT_SCOPE
@ -1174,6 +1181,16 @@ void V8ContextImpl::GetV8ObjectArrayBufferOrViewInfo(void* pvObject, V8Value& ar
return;
}
if (hObject->IsSharedArrayBuffer())
{
auto hSharedArrayBuffer = v8::Local<v8::SharedArrayBuffer>::Cast(hObject);
arrayBuffer = ExportValue(hObject);
offset = 0;
size = hSharedArrayBuffer->ByteLength();
length = size;
return;
}
if (hObject->IsDataView())
{
auto hDataView = v8::Local<v8::DataView>::Cast(hObject);
@ -1215,6 +1232,14 @@ void V8ContextImpl::InvokeWithV8ObjectArrayBufferOrViewData(void* pvObject, V8Ob
return;
}
if (hObject->IsSharedArrayBuffer())
{
auto hSharedArrayBuffer = v8::Local<v8::SharedArrayBuffer>::Cast(hObject);
auto spBackingStore = hSharedArrayBuffer->GetBackingStore();
(*pCallback)(spBackingStore->Data(), pvArg);
return;
}
if (hObject->IsDataView())
{
auto hDataView = v8::Local<v8::DataView>::Cast(hObject);
@ -2751,9 +2776,67 @@ v8::Local<v8::Value> V8ContextImpl::ImportValue(const V8Value& value)
{
V8ObjectHolder* pHolder;
V8Value::Subtype subtype;
if (value.AsV8Object(pHolder, subtype))
V8Value::Flags flags;
if (value.AsV8Object(pHolder, subtype, flags))
{
return CreateLocal(::HandleFromPtr<v8::Object>(pHolder->GetObject()));
if (pHolder->IsSameIsolate(m_spIsolateImpl))
{
return CreateLocal(::HandleFromPtr<v8::Object>(pHolder->GetObject()));
}
if (HasFlag(flags, V8Value::Flags::Shared))
{
const auto& spSharedObjectInfo = pHolder->GetSharedObjectInfo();
if (!spSharedObjectInfo.IsEmpty())
{
switch (subtype)
{
case V8Value::Subtype::ArrayBuffer:
return CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore());
case V8Value::Subtype::DataView:
return v8::DataView::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetSize());
case V8Value::Subtype::Uint8Array:
return v8::Uint8Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Uint8ClampedArray:
return v8::Uint8ClampedArray::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Int8Array:
return v8::Int8Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Uint16Array:
return v8::Uint16Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Int16Array:
return v8::Int16Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Uint32Array:
return v8::Uint32Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Int32Array:
return v8::Int32Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::BigUint64Array:
return v8::BigUint64Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::BigInt64Array:
return v8::BigInt64Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Float32Array:
return v8::Float32Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
case V8Value::Subtype::Float64Array:
return v8::Float64Array::New(CreateSharedArrayBuffer(spSharedObjectInfo->GetBackingStore()), spSharedObjectInfo->GetOffset(), spSharedObjectInfo->GetLength());
default:
break;
}
}
}
return GetUndefined();
}
}
@ -2857,6 +2940,9 @@ V8Value V8ContextImpl::ExportValue(v8::Local<v8::Value> hValue)
}
auto subtype = V8Value::Subtype::None;
auto flags = V8Value::Flags::None;
SharedPtr<V8SharedObjectInfo> spSharedObjectInfo;
if (hObject->IsPromise())
{
subtype = V8Value::Subtype::Promise;
@ -2869,11 +2955,34 @@ V8Value V8ContextImpl::ExportValue(v8::Local<v8::Value> hValue)
{
subtype = V8Value::Subtype::ArrayBuffer;
}
else if (hObject->IsSharedArrayBuffer())
{
subtype = V8Value::Subtype::ArrayBuffer;
flags = CombineFlags(flags, V8Value::Flags::Shared);
auto hSharedArrayBuffer = v8::Local<v8::SharedArrayBuffer>::Cast(hObject);
auto size = hSharedArrayBuffer->ByteLength();
spSharedObjectInfo = new V8SharedObjectInfo(hSharedArrayBuffer->GetBackingStore(), 0, size, size);
}
else if (hObject->IsArrayBufferView())
{
auto hArrayBufferView = v8::Local<v8::ArrayBufferView>::Cast(hObject);
auto offset = hArrayBufferView->ByteOffset();
auto size = hArrayBufferView->ByteLength();
auto spBackingStore = hArrayBufferView->Buffer()->GetBackingStore();
if (spBackingStore->IsShared())
{
flags = CombineFlags(flags, V8Value::Flags::Shared);
}
if (hObject->IsDataView())
{
subtype = V8Value::Subtype::DataView;
if (HasFlag(flags, V8Value::Flags::Shared))
{
spSharedObjectInfo = new V8SharedObjectInfo(std::move(spBackingStore), offset, size, size);
}
}
else if (hObject->IsTypedArray())
{
@ -2905,6 +3014,14 @@ V8Value V8ContextImpl::ExportValue(v8::Local<v8::Value> hValue)
{
subtype = V8Value::Subtype::Int32Array;
}
else if (hObject->IsBigUint64Array())
{
subtype = V8Value::Subtype::BigUint64Array;
}
else if (hObject->IsBigInt64Array())
{
subtype = V8Value::Subtype::BigInt64Array;
}
else if (hObject->IsFloat32Array())
{
subtype = V8Value::Subtype::Float32Array;
@ -2913,10 +3030,16 @@ V8Value V8ContextImpl::ExportValue(v8::Local<v8::Value> hValue)
{
subtype = V8Value::Subtype::Float64Array;
}
if (HasFlag(flags, V8Value::Flags::Shared) && (subtype != V8Value::Subtype::None))
{
auto hTypedArray = v8::Local<v8::TypedArray>::Cast(hObject);
spSharedObjectInfo = new V8SharedObjectInfo(std::move(spBackingStore), offset, size, hTypedArray->Length());
}
}
}
return V8Value(new V8ObjectHolderImpl(GetWeakBinding(), ::PtrFromHandle(CreatePersistent(hObject))), subtype);
return V8Value(new V8ObjectHolderImpl(GetWeakBinding(), ::PtrFromHandle(CreatePersistent(hObject)), spSharedObjectInfo), subtype, flags);
}
FROM_MAYBE_CATCH_CONSUME

Просмотреть файл

@ -40,8 +40,9 @@ public:
virtual void SetGlobalProperty(const StdString& name, const V8Value& value, bool globalMembers) override;
virtual void AwaitDebuggerAndPause() override;
virtual V8Value Execute(const V8DocumentInfo& documentInfo, const StdString& code, bool evaluate) override;
virtual void CancelAwaitDebugger() override;
virtual V8Value Execute(const V8DocumentInfo& documentInfo, const StdString& code, bool evaluate) override;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code) override;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, std::vector<uint8_t>& cacheBytes) override;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, const std::vector<uint8_t>& cacheBytes, bool& cacheAccepted) override;
@ -237,6 +238,11 @@ private:
return m_spIsolateImpl->CreateFunctionTemplate(callback, data, signature, length);
}
v8::Local<v8::SharedArrayBuffer> CreateSharedArrayBuffer(const std::shared_ptr<v8::BackingStore>& spBackingStore)
{
return m_spIsolateImpl->CreateSharedArrayBuffer(spBackingStore);
}
v8::MaybeLocal<v8::UnboundScript> CompileUnboundScript(v8::ScriptCompiler::Source* pSource, v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions, v8::ScriptCompiler::NoCacheReason noCacheReason = v8::ScriptCompiler::kNoCacheNoReason)
{
auto result = m_spIsolateImpl->CompileUnboundScript(pSource, options, noCacheReason);

Просмотреть файл

@ -65,6 +65,8 @@ public:
virtual void SetMaxStackUsage(size_t value) = 0;
virtual void AwaitDebuggerAndPause() = 0;
virtual void CancelAwaitDebugger() = 0;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code) = 0;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, std::vector<uint8_t>& cacheBytes) = 0;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, const std::vector<uint8_t>& cacheBytes, bool& cacheAccepted) = 0;

Просмотреть файл

@ -411,10 +411,6 @@ V8IsolateImpl::V8IsolateImpl(const StdString& name, const v8::ResourceConstraint
m_Name(name),
m_CallWithLockLevel(0),
m_DebuggingEnabled(false),
m_AwaitingDebugger(false),
m_InMessageLoop(false),
m_QuitMessageLoop(false),
m_AbortMessageLoop(false),
m_MaxArrayBufferAllocation(options.MaxArrayBufferAllocation),
m_ArrayBufferAllocation(0),
m_MaxHeapSize(0),
@ -663,9 +659,20 @@ void V8IsolateImpl::AwaitDebuggerAndPause()
if (m_DebuggingEnabled)
{
if (!m_upInspectorSession && !RunMessageLoop(true))
if (!m_upInspectorSession)
{
throw V8Exception(V8Exception::Type::Interrupt, m_Name, StdString(SL("Script execution interrupted by host while awaiting debugger connection")), false);
auto exitReason = RunMessageLoop(RunMessageLoopReason::AwaitingDebugger);
switch (exitReason)
{
case ExitMessageLoopReason::TerminatedExecution:
throw V8Exception(V8Exception::Type::Interrupt, m_Name, StdString(SL("Script execution interrupted by host while awaiting debugger connection")), false);
case ExitMessageLoopReason::CanceledAwaitDebugger:
return;
default:
_ASSERTE(exitReason == ExitMessageLoopReason::ResumedExecution);
}
}
_ASSERTE(m_upInspectorSession);
@ -681,6 +688,21 @@ void V8IsolateImpl::AwaitDebuggerAndPause()
//-----------------------------------------------------------------------------
void V8IsolateImpl::CancelAwaitDebugger()
{
BEGIN_MUTEX_SCOPE(m_DataMutex)
if (m_optRunMessageLoopReason == RunMessageLoopReason::AwaitingDebugger)
{
m_optExitMessageLoopReason = ExitMessageLoopReason::CanceledAwaitDebugger;
m_CallWithLockQueueChanged.notify_one();
}
END_MUTEX_SCOPE
}
//-----------------------------------------------------------------------------
V8ScriptHolder* V8IsolateImpl::Compile(const V8DocumentInfo& documentInfo, StdString&& code)
{
BEGIN_ISOLATE_SCOPE
@ -873,7 +895,7 @@ void V8IsolateImpl::WriteHeapSnapshot(void* pvStream)
void V8IsolateImpl::runMessageLoopOnPause(int /*contextGroupId*/)
{
RunMessageLoop(false);
RunMessageLoop(RunMessageLoopReason::PausedInDebugger);
}
//-----------------------------------------------------------------------------
@ -883,7 +905,7 @@ void V8IsolateImpl::quitMessageLoopOnPause()
_ASSERTE(IsCurrent() && IsLocked());
BEGIN_MUTEX_SCOPE(m_DataMutex)
m_QuitMessageLoop = true;
m_optExitMessageLoopReason = ExitMessageLoopReason::ResumedExecution;
END_MUTEX_SCOPE
}
@ -1459,19 +1481,17 @@ V8IsolateImpl::~V8IsolateImpl()
//-----------------------------------------------------------------------------
bool V8IsolateImpl::RunMessageLoop(bool awaitingDebugger)
V8IsolateImpl::ExitMessageLoopReason V8IsolateImpl::RunMessageLoop(RunMessageLoopReason reason)
{
_ASSERTE(IsCurrent() && IsLocked());
std::unique_lock<std::mutex> lock(m_DataMutex.GetImpl());
if (!m_InMessageLoop)
if (!m_optRunMessageLoopReason)
{
m_QuitMessageLoop = false;
m_AbortMessageLoop = false;
m_optExitMessageLoopReason.reset();
BEGIN_PULSE_VALUE_SCOPE(&m_AwaitingDebugger, awaitingDebugger)
BEGIN_PULSE_VALUE_SCOPE(&m_InMessageLoop, true)
BEGIN_PULSE_VALUE_SCOPE(&m_optRunMessageLoopReason, reason)
ProcessCallWithLockQueue(lock);
@ -1480,20 +1500,19 @@ bool V8IsolateImpl::RunMessageLoop(bool awaitingDebugger)
m_CallWithLockQueueChanged.wait(lock);
ProcessCallWithLockQueue(lock);
if (m_QuitMessageLoop || m_AbortMessageLoop)
if (m_optExitMessageLoopReason)
{
break;
}
}
END_PULSE_VALUE_SCOPE
END_PULSE_VALUE_SCOPE
ProcessCallWithLockQueue(lock);
return m_QuitMessageLoop;
return *m_optExitMessageLoopReason;
}
return false;
return ExitMessageLoopReason::NestedInvocation;
}
//-----------------------------------------------------------------------------
@ -1506,7 +1525,7 @@ void V8IsolateImpl::CallWithLockAsync(bool allowNesting, CallWithLockCallback&&
m_CallWithLockQueue.push(std::make_pair(allowNesting, std::move(callback)));
if (m_InMessageLoop)
if (m_optRunMessageLoopReason)
{
m_CallWithLockQueueChanged.notify_one();
return;

Просмотреть файл

@ -277,6 +277,11 @@ public:
return v8::FunctionTemplate::New(m_upIsolate.get(), callback, data, signature, length);
}
v8::Local<v8::SharedArrayBuffer> CreateSharedArrayBuffer(const std::shared_ptr<v8::BackingStore>& spBackingStore)
{
return v8::SharedArrayBuffer::New(m_upIsolate.get(), spBackingStore);
}
v8::MaybeLocal<v8::UnboundScript> CompileUnboundScript(v8::ScriptCompiler::Source* pSource, v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions, v8::ScriptCompiler::NoCacheReason noCacheReason = v8::ScriptCompiler::kNoCacheNoReason)
{
auto result = v8::ScriptCompiler::CompileUnboundScript(m_upIsolate.get(), pSource, options, noCacheReason);
@ -362,9 +367,9 @@ public:
{
BEGIN_MUTEX_SCOPE(m_DataMutex)
if (m_AwaitingDebugger)
if (m_optRunMessageLoopReason == RunMessageLoopReason::AwaitingDebugger)
{
m_AbortMessageLoop = true;
m_optExitMessageLoopReason = ExitMessageLoopReason::TerminatedExecution;
m_CallWithLockQueueChanged.notify_one();
return;
}
@ -447,6 +452,8 @@ public:
virtual void SetMaxStackUsage(size_t value) override;
virtual void AwaitDebuggerAndPause() override;
virtual void CancelAwaitDebugger() override;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code) override;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, std::vector<uint8_t>& cacheBytes) override;
virtual V8ScriptHolder* Compile(const V8DocumentInfo& documentInfo, StdString&& code, V8CacheType cacheType, const std::vector<uint8_t>& cacheBytes, bool& cacheAccepted) override;
@ -530,7 +537,21 @@ private:
Persistent<v8::UnboundScript> hScript;
};
bool RunMessageLoop(bool awaitingDebugger);
enum class RunMessageLoopReason
{
AwaitingDebugger,
PausedInDebugger
};
enum class ExitMessageLoopReason
{
ResumedExecution,
TerminatedExecution,
CanceledAwaitDebugger,
NestedInvocation
};
ExitMessageLoopReason RunMessageLoop(RunMessageLoopReason reason);
void CallWithLockAsync(bool allowNesting, CallWithLockCallback&& callback);
static void ProcessCallWithLockQueue(v8::Isolate* pIsolate, void* pvIsolateImpl);
@ -579,10 +600,8 @@ private:
void* m_pvDebugAgent;
std::unique_ptr<v8_inspector::V8Inspector> m_upInspector;
std::unique_ptr<v8_inspector::V8InspectorSession> m_upInspectorSession;
bool m_AwaitingDebugger;
bool m_InMessageLoop;
bool m_QuitMessageLoop;
bool m_AbortMessageLoop;
std::optional<RunMessageLoopReason> m_optRunMessageLoopReason;
std::optional<ExitMessageLoopReason> m_optExitMessageLoopReason;
size_t m_MaxArrayBufferAllocation;
size_t m_ArrayBufferAllocation;
std::atomic<size_t> m_MaxHeapSize;

Просмотреть файл

@ -3,6 +3,56 @@
#pragma once
//-----------------------------------------------------------------------------
// forward declarations
//-----------------------------------------------------------------------------
class V8IsolateImpl;
//-----------------------------------------------------------------------------
// V8SharedObjectInfo
//-----------------------------------------------------------------------------
class V8SharedObjectInfo final : public SharedPtrTarget
{
public:
V8SharedObjectInfo(std::shared_ptr<v8::BackingStore>&& spBackingStore, size_t offset, size_t size, size_t length):
m_spBackingStore(std::move(spBackingStore)),
m_Offset(offset),
m_Size(size),
m_Length(length)
{
}
const std::shared_ptr<v8::BackingStore>& GetBackingStore() const
{
return m_spBackingStore;
}
size_t GetOffset() const
{
return m_Offset;
}
size_t GetSize() const
{
return m_Size;
}
size_t GetLength() const
{
return m_Length;
}
private:
std::shared_ptr<v8::BackingStore> m_spBackingStore;
size_t m_Offset;
size_t m_Size;
size_t m_Length;
};
//-----------------------------------------------------------------------------
// V8ObjectHolder
//-----------------------------------------------------------------------------
@ -12,7 +62,9 @@ class V8ObjectHolder: public SharedPtrTarget
public:
virtual V8ObjectHolder* Clone() const = 0;
virtual bool IsSameIsolate(const SharedPtr<V8IsolateImpl>& spThat) const = 0;
virtual void* GetObject() const = 0;
virtual const SharedPtr<V8SharedObjectInfo>& GetSharedObjectInfo() const = 0;
virtual ~V8ObjectHolder() {}
};

Просмотреть файл

@ -7,9 +7,10 @@
// V8ObjectHolderImpl implementation
//-----------------------------------------------------------------------------
V8ObjectHolderImpl::V8ObjectHolderImpl(const SharedPtr<V8WeakContextBinding>& pBinding, void* pvObject):
m_spBinding(pBinding),
m_pvObject(pvObject)
V8ObjectHolderImpl::V8ObjectHolderImpl(const SharedPtr<V8WeakContextBinding>& spBinding, void* pvObject, const SharedPtr<V8SharedObjectInfo>& spSharedObjectInfo):
m_spBinding(spBinding),
m_pvObject(pvObject),
m_spSharedObjectInfo(spSharedObjectInfo)
{
}
@ -17,7 +18,20 @@ V8ObjectHolderImpl::V8ObjectHolderImpl(const SharedPtr<V8WeakContextBinding>& pB
V8ObjectHolderImpl* V8ObjectHolderImpl::Clone() const
{
return new V8ObjectHolderImpl(m_spBinding, m_spBinding->GetIsolateImpl()->AddRefV8Object(m_pvObject));
return new V8ObjectHolderImpl(m_spBinding, m_spBinding->GetIsolateImpl()->AddRefV8Object(m_pvObject), m_spSharedObjectInfo);
}
//-----------------------------------------------------------------------------
bool V8ObjectHolderImpl::IsSameIsolate(const SharedPtr<V8IsolateImpl>& spThat) const
{
SharedPtr<V8IsolateImpl> spIsolateImpl;
if (m_spBinding->TryGetIsolateImpl(spIsolateImpl))
{
return spIsolateImpl == spThat;
}
return false;
}
//-----------------------------------------------------------------------------
@ -29,6 +43,13 @@ void* V8ObjectHolderImpl::GetObject() const
//-----------------------------------------------------------------------------
const SharedPtr<V8SharedObjectInfo>& V8ObjectHolderImpl::GetSharedObjectInfo() const
{
return m_spSharedObjectInfo;
}
//-----------------------------------------------------------------------------
V8Value V8ObjectHolderImpl::GetProperty(const StdString& name) const
{
return m_spBinding->GetContextImpl()->GetV8ObjectProperty(m_pvObject, name);

Просмотреть файл

@ -13,10 +13,12 @@ class V8ObjectHolderImpl final: public V8ObjectHolder
public:
V8ObjectHolderImpl(const SharedPtr<V8WeakContextBinding>& spBinding, void* pvObject);
V8ObjectHolderImpl(const SharedPtr<V8WeakContextBinding>& spBinding, void* pvObject, const SharedPtr<V8SharedObjectInfo>& spSharedObjectInfo);
virtual V8ObjectHolderImpl* Clone() const override;
virtual bool IsSameIsolate(const SharedPtr<V8IsolateImpl>& spThat) const override;
virtual void* GetObject() const override;
virtual const SharedPtr<V8SharedObjectInfo>& GetSharedObjectInfo() const override;
V8Value GetProperty(const StdString& name) const;
void SetProperty(const StdString& name, const V8Value& value) const;
@ -40,4 +42,5 @@ private:
SharedPtr<V8WeakContextBinding> m_spBinding;
void* m_pvObject;
SharedPtr<V8SharedObjectInfo> m_spSharedObjectInfo;
};

Просмотреть файл

@ -490,12 +490,12 @@ NATIVE_ENTRY_POINT(void) V8Value_SetBigInt(V8Value* pV8Value, int32_t signBit, c
//-----------------------------------------------------------------------------
NATIVE_ENTRY_POINT(void) V8Value_SetV8Object(V8Value* pV8Value, const V8ObjectHandle& handle, V8Value::Subtype subtype) noexcept
NATIVE_ENTRY_POINT(void) V8Value_SetV8Object(V8Value* pV8Value, const V8ObjectHandle& handle, V8Value::Subtype subtype, V8Value::Flags flags) noexcept
{
auto spV8ObjectHolder = handle.GetEntity();
if (!spV8ObjectHolder.IsEmpty())
{
*pV8Value = V8Value(spV8ObjectHolder->Clone(), subtype);
*pV8Value = V8Value(spV8ObjectHolder->Clone(), subtype, flags);
}
}
@ -579,10 +579,12 @@ NATIVE_ENTRY_POINT(V8Value::Type) V8Value_Decode(const V8Value& value, int32_t&
{
V8ObjectHolder* pHolder;
V8Value::Subtype subtype;
if (value.AsV8Object(pHolder, subtype))
V8Value::Flags flags;
if (value.AsV8Object(pHolder, subtype, flags))
{
pvData = new V8ObjectHandle(pHolder->Clone());
uintValue = static_cast<std::underlying_type_t<V8Value::Subtype>>(subtype);
intValue = static_cast<std::underlying_type_t<V8Value::Flags>>(flags);
return V8Value::Type::V8Object;
}
}
@ -810,7 +812,25 @@ NATIVE_ENTRY_POINT(void) V8Isolate_AwaitDebuggerAndPause(const V8IsolateHandle&
auto spIsolate = handle.GetEntity();
if (!spIsolate.IsEmpty())
{
spIsolate->AwaitDebuggerAndPause();
try
{
spIsolate->AwaitDebuggerAndPause();
}
catch (const V8Exception& exception)
{
exception.ScheduleScriptEngineException();
}
}
}
//-----------------------------------------------------------------------------
NATIVE_ENTRY_POINT(void) V8Isolate_CancelAwaitDebugger(const V8IsolateHandle& handle) noexcept
{
auto spIsolate = handle.GetEntity();
if (!spIsolate.IsEmpty())
{
spIsolate->CancelAwaitDebugger();
}
}
@ -1153,6 +1173,17 @@ NATIVE_ENTRY_POINT(void) V8Context_AwaitDebuggerAndPause(const V8ContextHandle&
//-----------------------------------------------------------------------------
NATIVE_ENTRY_POINT(void) V8Context_CancelAwaitDebugger(const V8ContextHandle& handle) noexcept
{
auto spContext = handle.GetEntity();
if (!spContext.IsEmpty())
{
spContext->CancelAwaitDebugger();
}
}
//-----------------------------------------------------------------------------
NATIVE_ENTRY_POINT(void) V8Context_ExecuteCode(const V8ContextHandle& handle, StdString&& resourceName, StdString&& sourceMapUrl, uint64_t uniqueId, StdBool isModule, void* pvDocumentInfo, const StdString& code, StdBool evaluate, V8Value& result) noexcept
{
V8DocumentInfo documentInfo(std::move(resourceName), std::move(sourceMapUrl), uniqueId, isModule, pvDocumentInfo);
@ -1636,9 +1667,9 @@ NATIVE_ENTRY_POINT(void) V8Object_GetArrayBufferOrViewInfo(const V8ObjectHandle&
{
try
{
size_t tempOffset;
size_t tempSize;
size_t tempLength;
size_t tempOffset = 0;
size_t tempSize = 0;
size_t tempLength = 0;
V8ObjectHelpers::GetArrayBufferOrViewInfo(spV8ObjectHolder, arrayBuffer, tempOffset, tempSize, tempLength);
offset = tempOffset;

Просмотреть файл

@ -218,7 +218,7 @@ NATIVE_ENTRY_POINT(void) V8Value_SetUInt32(V8Value* pV8Value, uint32_t value) no
NATIVE_ENTRY_POINT(void) V8Value_SetString(V8Value* pV8Value, const StdChar* pValue, int32_t length) noexcept;
NATIVE_ENTRY_POINT(void) V8Value_SetDateTime(V8Value* pV8Value, double value) noexcept;
NATIVE_ENTRY_POINT(void) V8Value_SetBigInt(V8Value* pV8Value, int32_t signBit, const uint8_t* pBytes, int32_t length) noexcept;
NATIVE_ENTRY_POINT(void) V8Value_SetV8Object(V8Value* pV8Value, const V8ObjectHandle& handle, V8Value::Subtype subtype) noexcept;
NATIVE_ENTRY_POINT(void) V8Value_SetV8Object(V8Value* pV8Value, const V8ObjectHandle& handle, V8Value::Subtype subtype, V8Value::Flags flags) noexcept;
NATIVE_ENTRY_POINT(void) V8Value_SetHostObject(V8Value* pV8Value, void* pvObject) noexcept;
NATIVE_ENTRY_POINT(V8Value::Type) V8Value_Decode(const V8Value& value, int32_t& intValue, uint32_t& uintValue, double& doubleValue, const void*& pvData) noexcept;
NATIVE_ENTRY_POINT(void) V8Value_Delete(V8Value* pV8Value) noexcept;
@ -238,6 +238,7 @@ NATIVE_ENTRY_POINT(void) V8Isolate_SetHeapSizeSampleInterval(const V8IsolateHand
NATIVE_ENTRY_POINT(size_t) V8Isolate_GetMaxStackUsage(const V8IsolateHandle& handle) noexcept;
NATIVE_ENTRY_POINT(void) V8Isolate_SetMaxStackUsage(const V8IsolateHandle& handle, size_t size) noexcept;
NATIVE_ENTRY_POINT(void) V8Isolate_AwaitDebuggerAndPause(const V8IsolateHandle& handle) noexcept;
NATIVE_ENTRY_POINT(void) V8Isolate_CancelAwaitDebugger(const V8IsolateHandle& handle) noexcept;
NATIVE_ENTRY_POINT(V8ScriptHandle*) V8Isolate_Compile(const V8IsolateHandle& handle, StdString&& resourceName, StdString&& sourceMapUrl, uint64_t uniqueId, StdBool isModule, void* pvDocumentInfo, StdString&& code) noexcept;
NATIVE_ENTRY_POINT(V8ScriptHandle*) V8Isolate_CompileProducingCache(const V8IsolateHandle& handle, StdString&& resourceName, StdString&& sourceMapUrl, uint64_t uniqueId, StdBool isModule, void* pvDocumentInfo, StdString&& code, V8CacheType cacheType, std::vector<uint8_t>& cacheBytes) noexcept;
NATIVE_ENTRY_POINT(V8ScriptHandle*) V8Isolate_CompileConsumingCache(const V8IsolateHandle& handle, StdString&& resourceName, StdString&& sourceMapUrl, uint64_t uniqueId, StdBool isModule, void* pvDocumentInfo, StdString&& code, V8CacheType cacheType, const std::vector<uint8_t>& cacheBytes, StdBool& cacheAccepted) noexcept;
@ -261,6 +262,7 @@ NATIVE_ENTRY_POINT(void) V8Context_InvokeWithLock(const V8ContextHandle& handle,
NATIVE_ENTRY_POINT(void) V8Context_GetRootItem(const V8ContextHandle& handle, V8Value& item) noexcept;
NATIVE_ENTRY_POINT(void) V8Context_AddGlobalItem(const V8ContextHandle& handle, const StdString& name, const V8Value& value, StdBool globalMembers) noexcept;
NATIVE_ENTRY_POINT(void) V8Context_AwaitDebuggerAndPause(const V8ContextHandle& handle) noexcept;
NATIVE_ENTRY_POINT(void) V8Context_CancelAwaitDebugger(const V8ContextHandle& handle) noexcept;
NATIVE_ENTRY_POINT(void) V8Context_ExecuteCode(const V8ContextHandle& handle, StdString&& resourceName, StdString&& sourceMapUrl, uint64_t uniqueId, StdBool isModule, void* pvDocumentInfo, const StdString& code, StdBool evaluate, V8Value& result) noexcept;
NATIVE_ENTRY_POINT(V8ScriptHandle*) V8Context_Compile(const V8ContextHandle& handle, StdString&& resourceName, StdString&& sourceMapUrl, uint64_t uniqueId, StdBool isModule, void* pvDocumentInfo, StdString&& code) noexcept;
NATIVE_ENTRY_POINT(V8ScriptHandle*) V8Context_CompileProducingCache(const V8ContextHandle& handle, StdString&& resourceName, StdString&& sourceMapUrl, uint64_t uniqueId, StdBool isModule, void* pvDocumentInfo, StdString&& code, V8CacheType cacheType, std::vector<uint8_t>& cacheBytes) noexcept;

Просмотреть файл

@ -127,10 +127,19 @@ public:
Int16Array,
Uint32Array,
Int32Array,
BigUint64Array,
BigInt64Array,
Float32Array,
Float64Array
};
enum class Flags : uint16_t
{
// IMPORTANT: maintain bitwise equivalence with managed enum V8.SplitProxy.V8Value.Flags
None = 0,
Shared = 1
};
explicit V8Value(NonexistentInitializer):
m_Type(Type::Nonexistent)
{
@ -188,9 +197,10 @@ public:
m_Data.pBigInt = pBigInt;
}
V8Value(V8ObjectHolder* pV8ObjectHolder, Subtype subtype):
V8Value(V8ObjectHolder* pV8ObjectHolder, Subtype subtype, Flags flags):
m_Type(Type::V8Object),
m_Subtype(subtype)
m_Subtype(subtype),
m_Flags(flags)
{
m_Data.pV8ObjectHolder = pV8ObjectHolder;
}
@ -317,12 +327,13 @@ public:
return false;
}
bool AsV8Object(V8ObjectHolder*& pV8ObjectHolder, Subtype& subtype) const
bool AsV8Object(V8ObjectHolder*& pV8ObjectHolder, Subtype& subtype, Flags& flags) const
{
if (m_Type == Type::V8Object)
{
pV8ObjectHolder = m_Data.pV8ObjectHolder;
subtype = m_Subtype;
flags = m_Flags;
return true;
}
@ -368,6 +379,7 @@ private:
{
m_Type = that.m_Type;
m_Subtype = that.m_Subtype;
m_Flags = that.m_Flags;
if (m_Type == Type::Boolean)
{
@ -411,6 +423,7 @@ private:
{
m_Type = that.m_Type;
m_Subtype = that.m_Subtype;
m_Flags = that.m_Flags;
m_Data = that.m_Data;
that.m_Type = Type::Undefined;
}
@ -437,7 +450,8 @@ private:
Type m_Type;
Subtype m_Subtype;
int32_t m_Padding;
Flags m_Flags;
int16_t m_Padding;
Data m_Data;
};

Просмотреть файл

Просмотреть файл

1
Misc/macOS/.zprofile Normal file
Просмотреть файл

@ -0,0 +1 @@
export PROFILEPATH=$PATH

4
Misc/macOS/.zshrc Normal file
Просмотреть файл

@ -0,0 +1,4 @@
export PATH=$HOME/`arch`/bin:$PROFILEPATH
alias ll="ls -alF"
alias zx64="arch -arch x86_64 zsh"
alias zarm64="arch -arch arm64e zsh"

Просмотреть файл

@ -150,10 +150,9 @@
<Compile Include="..\..\ClearScript\Util\SpecialMemberNames.cs" Link="Util\SpecialMemberNames.cs" />
<Compile Include="..\..\ClearScript\Util\SpecialParamNames.cs" Link="Util\SpecialParamNames.cs" />
<Compile Include="..\..\ClearScript\Util\Test\AccessContextTestObject.cs" Link="Util\Test\AccessContextTestObject.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuidMocks.cs" Link="Util\TypeGuidMocks.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuids.cs" Link="Util\TypeGuids.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.cs" Link="Util\TypeHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.NetCore.cs" Link="Util\TypeHelpers.NetCore.cs" />
<Compile Include="..\..\ClearScript\Util\TypeTags.cs" Link="Util\TypeTags.cs" />
<Compile Include="..\..\ClearScript\Util\UniqueNameManager.cs" Link="Util\UniqueNameManager.cs" />
<Compile Include="..\..\ClearScript\Util\UnmanagedMemoryHelpers.cs" Link="Util\UnmanagedMemoryHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\VTableHelpers.cs" Link="Util\VTableHelpers.cs" />

Просмотреть файл

@ -46,6 +46,7 @@
<Compile Include="..\..\ClearScript\V8\SplitProxy\V8ScriptImpl.cs" Link="V8\SplitProxy\V8ScriptImpl.cs" />
<Compile Include="..\..\ClearScript\V8\SplitProxy\V8SplitProxyHelpers.cs" Link="V8\SplitProxy\V8SplitProxyHelpers.cs" />
<Compile Include="..\..\ClearScript\V8\SplitProxy\V8SplitProxyManaged.cs" Link="V8\SplitProxy\V8SplitProxyManaged.cs" />
<Compile Condition="'$(TargetFramework)'=='net5.0'" Include="..\..\ClearScript\V8\SplitProxy\V8SplitProxyManaged.Net5.cs" Link="V8\SplitProxy\V8SplitProxyManaged.Net5.cs" />
<Compile Include="..\..\ClearScript\V8\SplitProxy\V8SplitProxyNative.cs" Link="V8\SplitProxy\V8SplitProxyNative.cs" />
<Compile Include="..\..\ClearScript\V8\SplitProxy\V8SplitProxyNative.Generated.cs" Link="V8\SplitProxy\V8SplitProxyNative.Generated.cs" />
<Compile Include="..\..\ClearScript\V8\SplitProxy\V8TestProxyImpl.cs" Link="V8\SplitProxy\V8TestProxyImpl.cs" />

Просмотреть файл

@ -78,6 +78,7 @@
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.cs" Link="V8ScriptEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.NetStandard.cs" Link="V8ScriptEngineTest.NetStandard.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.Windows.cs" Link="V8ScriptEngineTest.Windows.cs" />
<Compile Include="..\..\ClearScriptTest\V8SharedObjectTest.cs" Link="V8SharedObjectTest.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptCoreEngineTest.cs" Link="VBScriptCoreEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptCoreEngineTest.Windows.cs" Link="VBScriptCoreEngineTest.Windows.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptEngineTest.cs" Link="VBScriptEngineTest.cs" />

Просмотреть файл

@ -152,10 +152,9 @@
<Compile Include="..\..\ClearScript\Util\SpecialMemberNames.cs" Link="Util\SpecialMemberNames.cs" />
<Compile Include="..\..\ClearScript\Util\SpecialParamNames.cs" Link="Util\SpecialParamNames.cs" />
<Compile Include="..\..\ClearScript\Util\Test\AccessContextTestObject.cs" Link="Util\Test\AccessContextTestObject.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuidMocks.cs" Link="Util\TypeGuidMocks.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuids.cs" Link="Util\TypeGuids.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.cs" Link="Util\TypeHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.NetFramework.cs" Link="Util\TypeHelpers.NetFramework.cs" />
<Compile Include="..\..\ClearScript\Util\TypeTags.cs" Link="Util\TypeTags.cs" />
<Compile Include="..\..\ClearScript\Util\UniqueNameManager.cs" Link="Util\UniqueNameManager.cs" />
<Compile Include="..\..\ClearScript\Util\UnmanagedMemoryHelpers.cs" Link="Util\UnmanagedMemoryHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\VTableHelpers.cs" Link="Util\VTableHelpers.cs" />

Просмотреть файл

@ -82,6 +82,7 @@
<Compile Include="..\..\ClearScriptTest\V8ModuleTest.cs" Link="V8ModuleTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.cs" Link="V8ScriptEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.Windows.cs" Link="V8ScriptEngineTest.Windows.cs" />
<Compile Include="..\..\ClearScriptTest\V8SharedObjectTest.cs" Link="V8SharedObjectTest.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptCoreEngineTest.cs" Link="VBScriptCoreEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptCoreEngineTest.Windows.cs" Link="VBScriptCoreEngineTest.Windows.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptEngineTest.cs" Link="VBScriptEngineTest.cs" />

Просмотреть файл

@ -150,10 +150,9 @@
<Compile Include="..\..\ClearScript\Util\SpecialMemberNames.cs" Link="Util\SpecialMemberNames.cs" />
<Compile Include="..\..\ClearScript\Util\SpecialParamNames.cs" Link="Util\SpecialParamNames.cs" />
<Compile Include="..\..\ClearScript\Util\Test\AccessContextTestObject.cs" Link="Util\Test\AccessContextTestObject.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuidMocks.cs" Link="Util\TypeGuidMocks.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuids.cs" Link="Util\TypeGuids.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.cs" Link="Util\TypeHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.NetCore.cs" Link="Util\TypeHelpers.NetCore.cs" />
<Compile Include="..\..\ClearScript\Util\TypeTags.cs" Link="Util\TypeTags.cs" />
<Compile Include="..\..\ClearScript\Util\UniqueNameManager.cs" Link="Util\UniqueNameManager.cs" />
<Compile Include="..\..\ClearScript\Util\UnmanagedMemoryHelpers.cs" Link="Util\UnmanagedMemoryHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\VTableHelpers.cs" Link="Util\VTableHelpers.cs" />

Просмотреть файл

@ -81,6 +81,7 @@
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.cs" Link="V8ScriptEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.NetStandard.cs" Link="V8ScriptEngineTest.NetStandard.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.Windows.cs" Link="V8ScriptEngineTest.Windows.cs" />
<Compile Include="..\..\ClearScriptTest\V8SharedObjectTest.cs" Link="V8SharedObjectTest.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptCoreEngineTest.cs" Link="VBScriptCoreEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptCoreEngineTest.Windows.cs" Link="VBScriptCoreEngineTest.Windows.cs" />
<Compile Include="..\..\ClearScriptTest\VBScriptEngineTest.cs" Link="VBScriptEngineTest.cs" />

Просмотреть файл

@ -171,10 +171,9 @@
<Compile Include="..\..\ClearScript\Util\SpecialMemberNames.cs" Link="Util\SpecialMemberNames.cs" />
<Compile Include="..\..\ClearScript\Util\SpecialParamNames.cs" Link="Util\SpecialParamNames.cs" />
<Compile Include="..\..\ClearScript\Util\Test\AccessContextTestObject.cs" Link="Util\Test\AccessContextTestObject.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuidMocks.cs" Link="Util\TypeGuidMocks.cs" />
<Compile Include="..\..\ClearScript\Util\TypeGuids.cs" Link="Util\TypeGuids.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.cs" Link="Util\TypeHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\TypeHelpers.NetCore.cs" Link="Util\TypeHelpers.NetCore.cs" />
<Compile Include="..\..\ClearScript\Util\TypeTags.cs" Link="Util\TypeTags.cs" />
<Compile Include="..\..\ClearScript\Util\UniqueNameManager.cs" Link="Util\UniqueNameManager.cs" />
<Compile Include="..\..\ClearScript\Util\UnmanagedMemoryHelpers.cs" Link="Util\UnmanagedMemoryHelpers.cs" />
<Compile Include="..\..\ClearScript\Util\VTableHelpers.cs" Link="Util\VTableHelpers.cs" />

Просмотреть файл

@ -27,6 +27,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\bin\Debug\uap10.0\ClearScript.V8.xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -38,6 +39,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\bin\Release\uap10.0\ClearScript.V8.xml</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="Exists('$(SolutionDir)ClearScript.snk')">
<SignAssembly>true</SignAssembly>

Просмотреть файл

@ -72,6 +72,7 @@
<Compile Include="..\..\ClearScriptTest\V8ModuleTest.cs" Link="V8ModuleTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.cs" Link="V8ScriptEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.NetStandard.cs" Link="V8ScriptEngineTest.NetStandard.cs" />
<Compile Include="..\..\ClearScriptTest\V8SharedObjectTest.cs" Link="V8SharedObjectTest.cs" />
</ItemGroup>
<ItemGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'">

Просмотреть файл

@ -71,6 +71,7 @@
<Compile Include="..\..\ClearScriptTest\V8ModuleTest.cs" Link="V8ModuleTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.cs" Link="V8ScriptEngineTest.cs" />
<Compile Include="..\..\ClearScriptTest\V8ScriptEngineTest.NetStandard.cs" Link="V8ScriptEngineTest.NetStandard.cs" />
<Compile Include="..\..\ClearScriptTest\V8SharedObjectTest.cs" Link="V8SharedObjectTest.cs" />
</ItemGroup>
<ItemGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'">

Просмотреть файл

@ -15,6 +15,7 @@ ifeq ($(KERNEL), Darwin)
TARGETARCH_X64 = x86_64
TARGETARCH_ARM = arm
TARGETARCH_ARM64 = arm64
MAKELINUX = true
else ifeq ($(KERNEL), Linux)
OS = linux
EXTENSION = so
@ -23,6 +24,7 @@ else ifeq ($(KERNEL), Linux)
TARGETARCH_X64 = x86_64
TARGETARCH_ARM = arm
TARGETARCH_ARM64 = aarch64
MAKELINUX = make
else
$(error unsupported operating system '$(KERNEL)')
endif
@ -150,13 +152,17 @@ zapv8:
rm -rf $(V8BUILDDIR)
buildall:
make
make CPU=x64
make CPU=arm64
make DEBUG=1
$(MAKELINUX) CPU=arm
make CPU=x64 DEBUG=1
make CPU=arm64 DEBUG=1
$(MAKELINUX) CPU=arm DEBUG=1
cleanall:
make clean
make clean CPU=x64
make clean CPU=arm64
make clean DEBUG=1
$(MAKELINUX) clean CPU=arm
make clean CPU=x64 DEBUG=1
make clean CPU=arm64 DEBUG=1
$(MAKELINUX) clean CPU=arm DEBUG=1

Просмотреть файл

@ -56,17 +56,17 @@ zapv8:
make -f $(UNIXDIR)/ClearScriptV8/Makefile zapv8
buildall:
make
make CPU=x64
make CPU=arm64
$(MAKELINUX) CPU=arm
make DEBUG=1
make CPU=x64 DEBUG=1
make CPU=arm64 DEBUG=1
$(MAKELINUX) CPU=arm DEBUG=1
cleanall:
make clean
make clean CPU=x64
make clean CPU=arm64
$(MAKELINUX) clean CPU=arm
make clean DEBUG=1
make clean CPU=x64 DEBUG=1
make clean CPU=arm64 DEBUG=1
$(MAKELINUX) clean CPU=arm DEBUG=1

Просмотреть файл

@ -1,6 +1,6 @@
#!/bin/bash
v8testedrev=9.5.172.21
v8testedrev=9.6.180.14
v8testedcommit=
if [[ $v8testedcommit == "" ]]; then

Просмотреть файл

@ -1,8 +1,8 @@
diff --git a/BUILD.gn b/BUILD.gn
index 5c7d931b27..665f145a6a 100644
index f491f2a4e6..3dad973c06 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -970,7 +970,7 @@ config("toolchain") {
@@ -971,7 +971,7 @@ config("toolchain") {
visibility = [ "./*" ]
defines = []
@ -12,10 +12,10 @@ index 5c7d931b27..665f145a6a 100644
if (v8_current_cpu == "arm") {
diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc
index 92686eff12..1c323efcce 100644
index e61933b05a..5456d10f64 100644
--- a/src/codegen/code-stub-assembler.cc
+++ b/src/codegen/code-stub-assembler.cc
@@ -13355,6 +13355,11 @@ TNode<String> CodeStubAssembler::Typeof(TNode<Object> value) {
@@ -13362,6 +13362,11 @@ TNode<String> CodeStubAssembler::Typeof(TNode<Object> value) {
GotoIf(InstanceTypeEqual(instance_type, ODDBALL_TYPE), &if_oddball);
@ -120,10 +120,10 @@ index d50767421a..f3fa0f3a70 100644
// Unprotect reserved page.
DWORD old_protect;
diff --git a/src/execution/isolate.h b/src/execution/isolate.h
index e7908eac6a..f0f62475e9 100644
index 2edc34a3e6..c73437eab3 100644
--- a/src/execution/isolate.h
+++ b/src/execution/isolate.h
@@ -598,7 +598,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
@@ -600,7 +600,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
// Returns the isolate inside which the current thread is running.
V8_INLINE static Isolate* Current() {
Isolate* isolate = TryGetCurrent();
@ -148,10 +148,10 @@ index 3f2968b55b..58d07d6023 100644
set_jslimit(SimulatorStack::JsLimitFromCLimit(isolate, limit));
real_climit_ = limit;
diff --git a/src/init/v8.cc b/src/init/v8.cc
index 7258ba8d93..14d3f0b3f7 100644
index a7b558bbad..d6b891733d 100644
--- a/src/init/v8.cc
+++ b/src/init/v8.cc
@@ -206,7 +206,6 @@ void V8::InitializeOncePerProcess() {
@@ -208,7 +208,6 @@ void V8::InitializeOncePerProcess() {
}
void V8::InitializePlatform(v8::Platform* platform) {
@ -160,10 +160,10 @@ index 7258ba8d93..14d3f0b3f7 100644
platform_ = platform;
v8::base::SetPrintStackTrace(platform_->GetStackTracePrinter());
diff --git a/src/objects/intl-objects.h b/src/objects/intl-objects.h
index 122ca4b746..c00bc6ddca 100644
index a696e09410..8880ed2e40 100644
--- a/src/objects/intl-objects.h
+++ b/src/objects/intl-objects.h
@@ -292,7 +292,7 @@ class Intl {
@@ -227,7 +227,7 @@ class Intl {
UErrorCode status = U_ZERO_ERROR;
UEnumeration* uenum =
uloc_openAvailableByType(ULOC_AVAILABLE_WITH_LEGACY_ALIASES, &status);
@ -173,10 +173,10 @@ index 122ca4b746..c00bc6ddca 100644
std::vector<std::string> all_locales;
const char* loc;
diff --git a/src/objects/js-date-time-format.cc b/src/objects/js-date-time-format.cc
index 868b0a3be2..c946dfb548 100644
index 2258a1ffdf..3c497347c0 100644
--- a/src/objects/js-date-time-format.cc
+++ b/src/objects/js-date-time-format.cc
@@ -1549,8 +1549,13 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
@@ -1555,8 +1555,13 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
// requestedLocales, opt, %DateTimeFormat%.[[RelevantExtensionKeys]],
// localeData).
//
@ -192,7 +192,7 @@ index 868b0a3be2..c946dfb548 100644
if (maybe_resolve_locale.IsNothing()) {
THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
diff --git a/src/objects/objects.cc b/src/objects/objects.cc
index 68482fe68f..f52247799a 100644
index db5a905f9c..ecc7b5dfbc 100644
--- a/src/objects/objects.cc
+++ b/src/objects/objects.cc
@@ -877,6 +877,12 @@ Handle<String> Object::TypeOf(Isolate* isolate, Handle<Object> object) {

Просмотреть файл

@ -1,7 +1,7 @@
@echo off
setlocal
set v8testedrev=9.5.172.21
set v8testedrev=9.6.180.14
set v8testedcommit=
if not "%v8testedcommit%"=="" goto ProcessArgs

Просмотреть файл

@ -1,5 +1,5 @@
<#
var version = new Version(7, 1, 7);
var version = new Version(7, 2, 0);
var versionSuffix = string.Empty;
new Random(versionSuffix.Length); // suppress "versionSuffix not used" warning
#>

Просмотреть файл

@ -462,10 +462,6 @@ on Ubuntu.</p>
<h2 style='margin-top:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:
9.35pt;margin-bottom:.0001pt'>macOS</h2>
<p class=MsoNormal style='margin-left:.25in'><b><span style='color:red'>Important:
</span></b>This procedure requires a recent macOS version running on x64
hardware.</p>
<p class=MsoNormal style='margin-left:.25in'>Heres how to acquire and build V8
and ClearScript on macOS:</p>
@ -492,6 +488,19 @@ style='color:red'>Important:</span></b> Ensure that the path to your
ClearScript root directory does not contain spaces or non-ASCII characters.</p>
<p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in'>5.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Launch
the <a href="https://en.wikipedia.org/wiki/Terminal_(macOS)">Terminal</a> app. <b><span
style='color:red'>Important: </span></b>If youre on an M1 machine, open a
Rosetta shell as follows:</p>
<p class=MsoListParagraph style='margin-top:10.0pt;margin-right:36.7pt;
margin-bottom:14.0pt;margin-left:1.0in;background:#F2F2F2'><span
style='font-size:10.0pt;line-height:115%;font-family:Consolas;color:gray'>user@host:~$</span><b><span
style='font-size:10.0pt;line-height:115%;font-family:Consolas;color:gray'> </span></b><b><span
style='font-size:10.0pt;line-height:115%;font-family:Consolas;color:black'>arch
-x86_64 zsh</span></b></p>
<p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in'>6.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Run
the following command from your ClearScript root directory:</p>
@ -500,7 +509,7 @@ the following command from your ClearScript root directory:</p>
line-height:115%;font-family:Consolas;color:gray'>user@host:/path/to/ClearScript$</span><b><span
style='font-size:10.0pt;line-height:115%;font-family:Consolas;color:gray'> </span></b><b><span
style='font-size:10.0pt;line-height:115%;font-family:Consolas;color:black'>make
-f Unix/Makefile [DEBUG=1]</span></b></p>
-f Unix/Makefile [DEBUG=1] [CPU=[arm64]]</span></b></p>
<p class=MsoNormal style='margin-left:.75in'>Specifying <b><span
style='font-size:10.0pt;line-height:115%;font-family:Consolas'>DEBUG=1</span></b>
@ -508,6 +517,10 @@ is optional; the default configuration is <b><span style='font-size:10.0pt;
line-height:115%;font-family:Consolas'>Release</span></b>. The output directory
is <b><span style='font-size:10.0pt;line-height:115%;font-family:Consolas'>bin/[Debug|Release]</span></b>.</p>
<p class=MsoNormal style='margin-left:.75in'>Specify <b><span style='font-size:
10.0pt;line-height:115%;font-family:Consolas'>CPU=arm64</span></b> to
cross-build for the arm64 (M1) architecture.</p>
<h1 style='margin-top:14.0pt;margin-right:0in;margin-bottom:0in;margin-left:
.5in;margin-bottom:.0001pt;text-indent:-.5in'>IV. Building strong-named
ClearScript assemblies (optional, Windows only)</h1>
@ -613,8 +626,8 @@ line-height:115%;font-family:Consolas;color:black'>ClearScriptV8.win-arm64.dll</
<h2 style='margin-top:6.0pt;margin-right:0in;margin-bottom:0in;margin-left:
9.0pt;margin-bottom:.0001pt'>Linux</h2>
<p class=MsoNormal style='margin-left:.25in'>Once you've built ClearScript,
here's how to reference it in your application:</p>
<p class=MsoNormal style='margin-left:.25in'>Once you've built ClearScript, here's
how to reference it in your application:</p>
<p class=MsoNormal style='margin-top:10.0pt;margin-right:36.7pt;margin-bottom:
14.0pt;margin-left:.5in;background:#F2F2F2'><span style='font-size:10.0pt;

Просмотреть файл

@ -7,13 +7,12 @@
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 05/15/2014
// Note : Copyright 2007-2015, Eric Woodruff, All rights reserved
// Compiler: Microsoft C#
//
// This file contains the code used to search for keywords within the help topics using the full-text index
// files created by the help file builder.
//
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
// distributed with the code. It can also be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
// distributed with the code and can be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
// and source files.
//

Просмотреть файл

@ -30,6 +30,7 @@
<HelpKINode Title="V8ScriptEngine.BeginCpuProfile Method " Url="html/Overload_Microsoft_ClearScript_V8_V8ScriptEngine_BeginCpuProfile.htm" />
</HelpKINode>
<HelpKINode Title="CacheDocument method" Url="html/M_Microsoft_ClearScript_DocumentLoader_CacheDocument.htm" />
<HelpKINode Title="CancelAwaitDebugger method" Url="html/M_Microsoft_ClearScript_V8_V8ScriptEngine_CancelAwaitDebugger.htm" />
<HelpKINode Title="cast(Of T) method" Url="html/M_Microsoft_ClearScript_HostFunctions_cast__1.htm" />
<HelpKINode Title="cast&lt;T&gt; method" Url="html/M_Microsoft_ClearScript_HostFunctions_cast__1.htm" />
<HelpKINode Title="Category property" Url="html/P_Microsoft_ClearScript_DocumentInfo_Category.htm" />
@ -263,12 +264,12 @@
<HelpKINode Title="V8ScriptEngine.Execute Method " Url="html/Overload_Microsoft_ClearScript_V8_V8ScriptEngine_Execute.htm" />
</HelpKINode>
<HelpKINode Title="ExecuteCommand method">
<HelpKINode Title="JScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_Core_JScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="JScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_JScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="JScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_Core_JScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="ScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_ScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="V8ScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_V8_V8ScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="VBScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_Core_VBScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="VBScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_VBScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="VBScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_Core_VBScriptEngine_ExecuteCommand.htm" />
</HelpKINode>
<HelpKINode Title="ExecuteDocument method" Url="html/Overload_Microsoft_ClearScript_ScriptEngine_ExecuteDocument.htm" />
<HelpKINode Title="ExecutionStarted property">
@ -299,8 +300,8 @@
<HelpKINode Title="Extensions.ToHostType method" Url="html/Overload_Microsoft_ClearScript_Extensions_ToHostType.htm" />
<HelpKINode Title="Extensions.ToRestrictedHostObject method" Url="html/Overload_Microsoft_ClearScript_Extensions_ToRestrictedHostObject.htm" />
<HelpKINode Title="FileNameExtension property">
<HelpKINode Title="JScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_Core_JScriptEngine_FileNameExtension.htm" />
<HelpKINode Title="JScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_JScriptEngine_FileNameExtension.htm" />
<HelpKINode Title="JScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_Core_JScriptEngine_FileNameExtension.htm" />
<HelpKINode Title="ScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_ScriptEngine_FileNameExtension.htm" />
<HelpKINode Title="V8ScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_V8_V8ScriptEngine_FileNameExtension.htm" />
<HelpKINode Title="VBScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_VBScriptEngine_FileNameExtension.htm" />
@ -556,20 +557,20 @@
<HelpKINode Title="JScriptEngine class">
<HelpKINode Title="JScriptEngine Class" Url="html/T_Microsoft_ClearScript_Windows_Core_JScriptEngine.htm" />
<HelpKINode Title="JScriptEngine Class" Url="html/T_Microsoft_ClearScript_Windows_JScriptEngine.htm" />
<HelpKINode Title="constructor" Url="html/Overload_Microsoft_ClearScript_Windows_JScriptEngine__ctor.htm" />
<HelpKINode Title="constructor" Url="html/Overload_Microsoft_ClearScript_Windows_Core_JScriptEngine__ctor.htm" />
<HelpKINode Title="methods" Url="html/Methods_T_Microsoft_ClearScript_Windows_JScriptEngine.htm" />
<HelpKINode Title="constructor" Url="html/Overload_Microsoft_ClearScript_Windows_JScriptEngine__ctor.htm" />
<HelpKINode Title="methods" Url="html/Methods_T_Microsoft_ClearScript_Windows_Core_JScriptEngine.htm" />
<HelpKINode Title="properties" Url="html/Properties_T_Microsoft_ClearScript_Windows_Core_JScriptEngine.htm" />
<HelpKINode Title="methods" Url="html/Methods_T_Microsoft_ClearScript_Windows_JScriptEngine.htm" />
<HelpKINode Title="properties" Url="html/Properties_T_Microsoft_ClearScript_Windows_JScriptEngine.htm" />
<HelpKINode Title="properties" Url="html/Properties_T_Microsoft_ClearScript_Windows_Core_JScriptEngine.htm" />
</HelpKINode>
<HelpKINode Title="JScriptEngine.ExecuteCommand method">
<HelpKINode Title="JScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_Core_JScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="JScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_JScriptEngine_ExecuteCommand.htm" />
</HelpKINode>
<HelpKINode Title="JScriptEngine.FileNameExtension property">
<HelpKINode Title="JScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_Core_JScriptEngine_FileNameExtension.htm" />
<HelpKINode Title="JScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_JScriptEngine_FileNameExtension.htm" />
<HelpKINode Title="JScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_Core_JScriptEngine_FileNameExtension.htm" />
</HelpKINode>
<HelpKINode Title="JScriptEngine.JScriptEngine constructor">
<HelpKINode Title="JScriptEngine Constructor " Url="html/Overload_Microsoft_ClearScript_Windows_Core_JScriptEngine__ctor.htm" />
@ -1080,6 +1081,7 @@
<HelpKINode Title="properties" Url="html/Properties_T_Microsoft_ClearScript_V8_V8ScriptEngine.htm" />
</HelpKINode>
<HelpKINode Title="V8ScriptEngine.BeginCpuProfile method" Url="html/Overload_Microsoft_ClearScript_V8_V8ScriptEngine_BeginCpuProfile.htm" />
<HelpKINode Title="V8ScriptEngine.CancelAwaitDebugger method" Url="html/M_Microsoft_ClearScript_V8_V8ScriptEngine_CancelAwaitDebugger.htm" />
<HelpKINode Title="V8ScriptEngine.CollectCpuProfileSample method" Url="html/M_Microsoft_ClearScript_V8_V8ScriptEngine_CollectCpuProfileSample.htm" />
<HelpKINode Title="V8ScriptEngine.CollectGarbage method" Url="html/M_Microsoft_ClearScript_V8_V8ScriptEngine_CollectGarbage.htm" />
<HelpKINode Title="V8ScriptEngine.Compile method" Url="html/Overload_Microsoft_ClearScript_V8_V8ScriptEngine_Compile.htm" />
@ -1114,18 +1116,18 @@
</HelpKINode>
<HelpKINode Title="Values property" Url="html/P_Microsoft_ClearScript_PropertyBag_Values.htm" />
<HelpKINode Title="VBScriptEngine class">
<HelpKINode Title="VBScriptEngine Class" Url="html/T_Microsoft_ClearScript_Windows_Core_VBScriptEngine.htm" />
<HelpKINode Title="VBScriptEngine Class" Url="html/T_Microsoft_ClearScript_Windows_VBScriptEngine.htm" />
<HelpKINode Title="constructor" Url="html/Overload_Microsoft_ClearScript_Windows_Core_VBScriptEngine__ctor.htm" />
<HelpKINode Title="VBScriptEngine Class" Url="html/T_Microsoft_ClearScript_Windows_Core_VBScriptEngine.htm" />
<HelpKINode Title="constructor" Url="html/Overload_Microsoft_ClearScript_Windows_VBScriptEngine__ctor.htm" />
<HelpKINode Title="methods" Url="html/Methods_T_Microsoft_ClearScript_Windows_VBScriptEngine.htm" />
<HelpKINode Title="constructor" Url="html/Overload_Microsoft_ClearScript_Windows_Core_VBScriptEngine__ctor.htm" />
<HelpKINode Title="methods" Url="html/Methods_T_Microsoft_ClearScript_Windows_Core_VBScriptEngine.htm" />
<HelpKINode Title="properties" Url="html/Properties_T_Microsoft_ClearScript_Windows_VBScriptEngine.htm" />
<HelpKINode Title="methods" Url="html/Methods_T_Microsoft_ClearScript_Windows_VBScriptEngine.htm" />
<HelpKINode Title="properties" Url="html/Properties_T_Microsoft_ClearScript_Windows_Core_VBScriptEngine.htm" />
<HelpKINode Title="properties" Url="html/Properties_T_Microsoft_ClearScript_Windows_VBScriptEngine.htm" />
</HelpKINode>
<HelpKINode Title="VBScriptEngine.ExecuteCommand method">
<HelpKINode Title="VBScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_VBScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="VBScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_Core_VBScriptEngine_ExecuteCommand.htm" />
<HelpKINode Title="VBScriptEngine.ExecuteCommand Method " Url="html/M_Microsoft_ClearScript_Windows_VBScriptEngine_ExecuteCommand.htm" />
</HelpKINode>
<HelpKINode Title="VBScriptEngine.FileNameExtension property">
<HelpKINode Title="VBScriptEngine.FileNameExtension Property " Url="html/P_Microsoft_ClearScript_Windows_Core_VBScriptEngine_FileNameExtension.htm" />

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1 +1 @@
{"json":[2359298,16646147,17235970,18546689,22609921,42270722],"jscript":[22347778,23003137,23855106,24576001,25165825,25362433,25624577,25755649,26214401,26279938,26542081,26804226,29753349,32505861,42008578,43515910,46399494,46530561,47185923],"javascript":[1441793,1507329,1572865,1835009,2293761,3407873,5242881,5308417,5636097,5832706,5898241,6225921,6619137,6815745,7077889,7143425,7405569,7471105,7667713,7733249,7864321,8192001,8257537,8388609,8454145,8585217,8650753,8716289,9240577,9568257,9830401,9895938,9961473,10092545,10158082,10223618,10289154,10420226,10551297,10682369,10813442,10878978,10944513,11010050,11141122,11206657,11534338,11730946,12189697,12386306,12451842,12713986,12910594,13041666,14352386,15400962,25493513,26083331,27983873,28573697,28966913,29491201,31916034,32243713,32571394,33226753,33751041,34275329,37552129,39059458,39321603,39714818,39780355,40239106,40697860,40763394,41287682,42008580,42467329,43319300,43712516,46923777,46989318,47448067,47513602],"javascrip":[15532033,37158913,46333953],"javascriptextensions":[3407875,10289154,10813442,11010050,11730946,12713986,12910594,13041666,14352386,15400962,25493505,28573698,43319303],"jscriptengine":[3801091,4194307,22347782,23003142,23855110,24117251,24576006,24969219,25165830,25362438,25624582,25755654,26214406,26279937,26542086,26804225,29753351,32505863,34537475,37421059,40173571,41484291,43515916,45613057,46399500,47054849,47185922],"just":[47185921]}
{"json":[2883586,16384003,16973826,18874369,21495809,46202882],"jscript":[21561345,22413313,23003137,23330817,23724033,24051713,24838146,24969218,26804225,27394049,27525125,30015490,30081029,30605314,42008582,42598401,44630018,45416451,47120390],"javascript":[1507329,1638401,1835009,1966081,2490369,4194305,5242881,5636097,6029313,6422529,6488066,6553601,6881281,7077889,7208961,7471105,7536641,7667713,7864321,7929857,8060929,8192001,8323073,8650753,8716289,8781825,9043969,9240577,9437185,9502721,9568257,9699330,9764866,9830401,9895937,10092545,10158081,10223617,10289153,10420226,10485762,10551298,10616834,10813442,10878977,11272194,11599874,11796482,11927554,12058626,12451842,12713986,12779522,12910594,13828098,15400962,28180481,28311561,28639233,29163523,29687809,30277633,31326209,32964610,33423361,33619970,34013185,34537474,34930689,35979265,40108034,40566786,41025538,41287682,43253761,44630020,45809667,45940738,46071811,46137347,46268417,46465030,46530564,46989316,47054852],"javascrip":[17367041,38076417,44564481],"javascriptextensions":[4194307,10551298,11272194,11927554,12058626,12451842,12713986,12779522,13828098,15400962,28311553,31326210,46989319],"jscriptengine":[3997699,4587523,21102595,21561350,22413318,23003142,23330822,23724038,24051718,24838150,24969222,26017795,26804230,27394054,27525127,30015489,30081031,30605313,33226755,35192835,41091075,42008588,43450371,45350913,45416450,47120396,47513601],"just":[45416449]}

Просмотреть файл

@ -1 +1 @@
{"kind":[17563649,18153473,18219009,19267585,19857409,20250625,20709377,21037057,21823489,22085633,22151169,22282241,22478849,23265281,23527425,24444929,24772609,25034753,25296897,26345473,26673153,27000833,29229057,31326209,46989313],"keys":[28377089,31784961,32374786,35323911,44892161,46727169,47251458],"key":[5701636,10747910,11272198,11599878,11665414,32374785,32636929,34013190,45809665,47251461],"keyword":[15532033],"keyvaluepair":[5701638,32374786,44892168,47251472]}
{"kind":[17694721,18153473,19267585,19595265,20054017,20185089,20840449,21168129,21626881,21757953,21889025,22151169,23068673,23396353,23527425,23855105,24313857,24641537,25165825,25624577,25952257,26279937,27590657,27721729,46465025],"keys":[29097985,31784961,33161218,37158919,39649281,41222145,45547522],"key":[4128772,11010054,12255238,12845062,13303814,28966913,33161217,36044806,42926081,45547525],"keyword":[17367041],"keyvaluepair":[4128774,33161218,39649288,45547536]}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1 +1 @@
{"qux":[7143425],"qualified":[1310721,3145729,5832705,6225921,9175041,11206657,11337729,12189697,13434881,14090241,14614529,15466497,43843585,44826625]}
{"qux":[9043969],"qualified":[1245185,3276801,6488065,7536641,8519681,9240577,9371649,10223617,13959169,14548993,16580609,17891329,42532865,46858241]}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше