ClearScript 7.3: Added V8ScriptEngineFlags.EnableStringifyEnhancements (GitHub Issue #376); the V8 ICU data is now packaged as a managed library to ease deployment; V8 and JScript startup scripts are now minified; fixed Exception.TargetSite reflection hole and added V8ScriptEngineFlags.HideHostExceptions (GitHub Issue #382); fixed typeof-literal comparison in V8; V8Update.cmd now works in a Visual Studio 2022 command prompt; Rosetta is no longer required for macOS builds on the arm64 (M1) architecture; updated build, deployment, and API documentation. Tested with V8 10.2.154.5.
This commit is contained in:
Родитель
cc2f94607d
Коммит
51dc719394
|
@ -34,6 +34,7 @@ _ReSharper*/
|
|||
*.VC.db
|
||||
V8/build/
|
||||
V8/DepotTools.zip
|
||||
V8/icudtl.dat
|
||||
.vs/
|
||||
packages/
|
||||
NuGet/Private/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29418.71
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32519.379
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptTest", "NetFramework\ClearScriptTest\ClearScriptTest.csproj", "{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
|
@ -32,11 +32,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptConsole", "NetCo
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptTest", "NetCore\ClearScriptTest\ClearScriptTest.csproj", "{269669D3-78D8-4AF3-A2AF-08D3446BD6BC}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7B3EA81F-F60B-46DB-B3F0-22F68E8A8FAD} = {7B3EA81F-F60B-46DB-B3F0-22F68E8A8FAD}
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
{C8AE52BB-BFEE-4816-A9FE-8653CEE36C96} = {C8AE52BB-BFEE-4816-A9FE-8653CEE36C96}
|
||||
{497012BC-959C-43A0-90A6-156A35DF2F43} = {497012BC-959C-43A0-90A6-156A35DF2F43}
|
||||
{6576FFFD-BA73-4123-8E4B-8589E5163C04} = {6576FFFD-BA73-4123-8E4B-8589E5163C04}
|
||||
{7B3EA81F-F60B-46DB-B3F0-22F68E8A8FAD} = {7B3EA81F-F60B-46DB-B3F0-22F68E8A8FAD}
|
||||
{C8AE52BB-BFEE-4816-A9FE-8653CEE36C96} = {C8AE52BB-BFEE-4816-A9FE-8653CEE36C96}
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".NET Framework", ".NET Framework", "{526BA3EF-4E1D-48C1-9923-2485B63993EE}"
|
||||
|
@ -68,6 +68,7 @@ EndProject
|
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.V8", "NetFramework\ClearScript.V8\ClearScript.V8.csproj", "{59CC81A3-3D97-469A-9C8B-533F920085F1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{2D63EA35-BA9C-4E77-B5A4-4938DBBFEFA6} = {2D63EA35-BA9C-4E77-B5A4-4938DBBFEFA6}
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C} = {47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}
|
||||
{725B6D7A-ECC7-4A28-AF52-B1CB22C37134} = {725B6D7A-ECC7-4A28-AF52-B1CB22C37134}
|
||||
{CDCF4EEA-1CA4-412E-8C77-78893A67A577} = {CDCF4EEA-1CA4-412E-8C77-78893A67A577}
|
||||
EndProjectSection
|
||||
|
@ -84,6 +85,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.Windows", "NetC
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.V8", "NetCore\ClearScript.V8\ClearScript.V8.csproj", "{C8AE52BB-BFEE-4816-A9FE-8653CEE36C96}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C} = {47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}
|
||||
{59CC81A3-3D97-469A-9C8B-533F920085F1} = {59CC81A3-3D97-469A-9C8B-533F920085F1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
@ -101,8 +103,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptConsole", "Unix\
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptTest", "Unix\ClearScriptTest\ClearScriptTest.csproj", "{052E036D-6D60-4FCA-AA8E-4CF56BC2058D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
{3CD8AB65-BA34-4BB9-862F-D31CE861560F} = {3CD8AB65-BA34-4BB9-862F-D31CE861560F}
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ClearScriptV8.win-arm64", "ClearScriptV8\win-arm64\ClearScriptV8.win-arm64.vcxproj", "{725B6D7A-ECC7-4A28-AF52-B1CB22C37134}"
|
||||
|
@ -119,8 +121,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClearScript.Core", "UWP\Cle
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClearScript.V8", "UWP\ClearScript.V8\ClearScript.V8.csproj", "{CF1FD52F-A933-48D9-92A4-A39565896A42}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{D3391831-65CE-4C1E-A21B-01A283F3E193} = {D3391831-65CE-4C1E-A21B-01A283F3E193}
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C} = {47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}
|
||||
{59CC81A3-3D97-469A-9C8B-533F920085F1} = {59CC81A3-3D97-469A-9C8B-533F920085F1}
|
||||
{D3391831-65CE-4C1E-A21B-01A283F3E193} = {D3391831-65CE-4C1E-A21B-01A283F3E193}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.Windows.Core", "NetCore\ClearScript.Windows.Core\ClearScript.Windows.Core.csproj", "{B9C99091-E616-4DC2-A711-4DCDAC602E38}"
|
||||
|
@ -139,6 +142,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.Core", "NetStan
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.V8", "NetStandard\ClearScript.V8\ClearScript.V8.csproj", "{0DEC74E5-FF8A-4B61-B847-875BAD0AE781}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C} = {47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}
|
||||
{59CC81A3-3D97-469A-9C8B-533F920085F1} = {59CC81A3-3D97-469A-9C8B-533F920085F1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
@ -149,15 +153,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.Windows.Core",
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptTest.NetStandard", "NetStandard\ClearScriptTest.NetStandard\ClearScriptTest.NetStandard.csproj", "{BF28C9F2-2935-4FDE-B812-977D601F9208}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
{C0E7BCAD-B4B3-4291-A87A-384D5F99C413} = {C0E7BCAD-B4B3-4291-A87A-384D5F99C413}
|
||||
{6F6B59D0-6538-4D02-91D2-07D24DAFE39A} = {6F6B59D0-6538-4D02-91D2-07D24DAFE39A}
|
||||
{C0E7BCAD-B4B3-4291-A87A-384D5F99C413} = {C0E7BCAD-B4B3-4291-A87A-384D5F99C413}
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptTest.NetStandard", "Unix\ClearScriptTest.NetStandard\ClearScriptTest.NetStandard.csproj", "{EF6090B9-7349-4868-9C43-D7D3F048C54F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
{3CD8AB65-BA34-4BB9-862F-D31CE861560F} = {3CD8AB65-BA34-4BB9-862F-D31CE861560F}
|
||||
{EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D} = {EDC7144E-FDA9-4CC7-B2CD-B5EBFD610A7D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptConsole", "NetStandard\ClearScriptConsole\ClearScriptConsole.csproj", "{C0E7BCAD-B4B3-4291-A87A-384D5F99C413}"
|
||||
|
@ -165,6 +169,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScriptConsole", "NetSt
|
|||
{28980C99-77E7-4B62-8484-AF06C5745B8C} = {28980C99-77E7-4B62-8484-AF06C5745B8C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScript.V8.ICUData", "NetStandard\ClearScript.V8.ICUData\ClearScript.V8.ICUData.csproj", "{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -283,6 +289,10 @@ Global
|
|||
{C0E7BCAD-B4B3-4291-A87A-384D5F99C413}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C0E7BCAD-B4B3-4291-A87A-384D5F99C413}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C0E7BCAD-B4B3-4291-A87A-384D5F99C413}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -316,6 +326,7 @@ Global
|
|||
{BF28C9F2-2935-4FDE-B812-977D601F9208} = {3047C214-A12B-4C8B-AEED-021FAA0B4CD3}
|
||||
{EF6090B9-7349-4868-9C43-D7D3F048C54F} = {48C9730D-CA6C-47ED-B72C-DB9B6EE24D47}
|
||||
{C0E7BCAD-B4B3-4291-A87A-384D5F99C413} = {3047C214-A12B-4C8B-AEED-021FAA0B4CD3}
|
||||
{47FC5CB5-A6F2-4FEE-99F8-A758D3A7373C} = {3047C214-A12B-4C8B-AEED-021FAA0B4CD3}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3BAF1393-35E4-45F1-AC56-4A22646B56E5}
|
||||
|
|
|
@ -7,6 +7,6 @@ namespace Microsoft.ClearScript
|
|||
/// Represents a method that specifies to a script engine whether script execution should continue.
|
||||
/// </summary>
|
||||
/// <returns><c>True</c> to continue script execution, <c>false</c> to interrupt it.</returns>
|
||||
/// <seealso cref="ScriptEngine.ContinuationCallback"/>
|
||||
/// <c><seealso cref="ScriptEngine.ContinuationCallback"/></c>
|
||||
public delegate bool ContinuationCallback();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -15,7 +15,7 @@ namespace Microsoft.ClearScript
|
|||
// ReSharper disable EmptyConstructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="CustomAttributeLoader"/> instance.
|
||||
/// Initializes a new <c><see cref="CustomAttributeLoader"/></c> instance.
|
||||
/// </summary>
|
||||
public CustomAttributeLoader()
|
||||
{
|
||||
|
|
|
@ -10,21 +10,21 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This attribute is applicable to classes, enums, interfaces, structs, and assemblies. Use
|
||||
/// <see cref="ScriptUsageAttribute"/>, <see cref="ScriptMemberAttribute"/>, or
|
||||
/// <see cref="NoScriptAccessAttribute"/> to override it for individual type members.
|
||||
/// <c><see cref="ScriptUsageAttribute"/></c>, <c><see cref="ScriptMemberAttribute"/></c>, or
|
||||
/// <c><see cref="NoScriptAccessAttribute"/></c> to override it for individual type members.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Assembly)]
|
||||
public class DefaultScriptUsageAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="DefaultScriptUsageAttribute"/> instance.
|
||||
/// Initializes a new <c><see cref="DefaultScriptUsageAttribute"/></c> instance.
|
||||
/// </summary>
|
||||
public DefaultScriptUsageAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="DefaultScriptUsageAttribute"/> instance with the specified default script access setting.
|
||||
/// Initializes a new <c><see cref="DefaultScriptUsageAttribute"/></c> instance with the specified default script access setting.
|
||||
/// </summary>
|
||||
/// <param name="access">The default script access setting for type members.</param>
|
||||
public DefaultScriptUsageAttribute(ScriptAccess access)
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Microsoft.ClearScript
|
|||
// ReSharper disable EmptyConstructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="Document"/> instance.
|
||||
/// Initializes a new <c><see cref="Document"/></c> instance.
|
||||
/// </summary>
|
||||
protected Document()
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Microsoft.ClearScript
|
|||
/// categories. These are distinct from the caches used by document loaders.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <seealso cref="DocumentLoader.MaxCacheSize"/>
|
||||
/// <c><seealso cref="DocumentLoader.MaxCacheSize"/></c>
|
||||
public uint MaxCacheSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Microsoft.ClearScript
|
|||
private ulong uniqueId;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="DocumentInfo"/> structure with the specified document name.
|
||||
/// Initializes a new <c><see cref="DocumentInfo"/></c> structure with the specified document name.
|
||||
/// </summary>
|
||||
/// <param name="name">The document name.</param>
|
||||
public DocumentInfo(string name)
|
||||
|
@ -32,7 +32,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="DocumentInfo"/> structure with the specified document URI.
|
||||
/// Initializes a new <c><see cref="DocumentInfo"/></c> structure with the specified document URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The document URI.</param>
|
||||
public DocumentInfo(Uri uri)
|
||||
|
@ -94,8 +94,8 @@ namespace Microsoft.ClearScript
|
|||
/// <para>
|
||||
/// Use
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta">import.meta</see></c>
|
||||
/// to access the context information of a <see cref="ModuleCategory.Standard"/> JavaScript
|
||||
/// module. In a <see cref="ModuleCategory.CommonJS"/> module, use <c>module.meta</c>.
|
||||
/// to access the context information of a <c><see cref="ModuleCategory.Standard"/></c> JavaScript
|
||||
/// module. In a <c><see cref="ModuleCategory.CommonJS"/></c> module, use <c>module.meta</c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public DocumentContextCallback ContextCallback { get; set; }
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Microsoft.ClearScript
|
|||
// ReSharper disable EmptyConstructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="DocumentLoader"/> instance.
|
||||
/// Initializes a new <c><see cref="DocumentLoader"/></c> instance.
|
||||
/// </summary>
|
||||
protected DocumentLoader()
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ namespace Microsoft.ClearScript
|
|||
/// This property specifies the maximum number of documents to be cached by the document
|
||||
/// loader. For the default document loader, its initial value is 1024.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Default"/>
|
||||
/// <c><seealso cref="Default"/></c>
|
||||
public virtual uint MaxCacheSize
|
||||
{
|
||||
get => 0;
|
||||
|
@ -57,11 +57,11 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="specifier">A string specifying the document to be loaded.</param>
|
||||
/// <param name="category">An optional category for the requested document.</param>
|
||||
/// <param name="contextCallback">An optional context callback for the requested document.</param>
|
||||
/// <returns>A <see cref="Document"/> instance that represents the loaded document.</returns>
|
||||
/// <returns>A <c><see cref="Document"/></c> instance that represents the loaded document.</returns>
|
||||
/// <remarks>
|
||||
/// A loaded document must have an absolute <see cref="DocumentInfo.Uri">URI</see>. Once a
|
||||
/// load operation has completed successfully, subsequent requests that resolve to the same
|
||||
/// URI are expected to return the same <see cref="Document"/> reference, although loaders
|
||||
/// URI are expected to return the same <c><see cref="Document"/></c> reference, although loaders
|
||||
/// are not required to manage document caches of unlimited size.
|
||||
/// </remarks>
|
||||
public virtual Document LoadDocument(DocumentSettings settings, DocumentInfo? sourceInfo, string specifier, DocumentCategory category, DocumentContextCallback contextCallback)
|
||||
|
@ -92,11 +92,11 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="specifier">A string specifying the document to be loaded.</param>
|
||||
/// <param name="category">An optional category for the requested document.</param>
|
||||
/// <param name="contextCallback">An optional context callback for the requested document.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. Upon completion, the task's result is a <see cref="Document"/> instance that represents the loaded document.</returns>
|
||||
/// <returns>A task that represents the asynchronous operation. Upon completion, the task's result is a <c><see cref="Document"/></c> instance that represents the loaded document.</returns>
|
||||
/// <remarks>
|
||||
/// A loaded document must have an absolute <see cref="DocumentInfo.Uri">URI</see>. Once a
|
||||
/// load operation has completed successfully, subsequent requests that resolve to the same
|
||||
/// URI are expected to return the same <see cref="Document"/> reference, although loaders
|
||||
/// URI are expected to return the same <c><see cref="Document"/></c> reference, although loaders
|
||||
/// are not required to manage document caches of unlimited size.
|
||||
/// </remarks>
|
||||
public abstract Task<Document> LoadDocumentAsync(DocumentSettings settings, DocumentInfo? sourceInfo, string specifier, DocumentCategory category, DocumentContextCallback contextCallback);
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Microsoft.ClearScript
|
|||
// ReSharper disable EmptyConstructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="DocumentSettings"/> instance.
|
||||
/// Initializes a new <c><see cref="DocumentSettings"/></c> instance.
|
||||
/// </summary>
|
||||
public DocumentSettings()
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This property is used as an alternative to <see cref="DocumentInfo.ContextCallback"/>.
|
||||
/// This property is used as an alternative to <c><see cref="DocumentInfo.ContextCallback"/></c>.
|
||||
/// If specified, the callback is invoked the first time a module attempts to retrieve its
|
||||
/// context information. The properties it returns are made available to the module
|
||||
/// implementation. This mechanism can be used to expose host resources selectively,
|
||||
|
@ -76,8 +76,8 @@ namespace Microsoft.ClearScript
|
|||
/// <para>
|
||||
/// Use
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta">import.meta</see></c>
|
||||
/// to access the context information of a <see cref="ModuleCategory.Standard"/> JavaScript
|
||||
/// module. In a <see cref="ModuleCategory.CommonJS"/> module, use <c>module.meta</c>.
|
||||
/// to access the context information of a <c><see cref="ModuleCategory.Standard"/></c> JavaScript
|
||||
/// module. In a <c><see cref="ModuleCategory.CommonJS"/></c> module, use <c>module.meta</c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public DocumentContextCallback ContextCallback { get; set; }
|
||||
|
@ -90,7 +90,7 @@ namespace Microsoft.ClearScript
|
|||
/// <remarks>
|
||||
/// System documents take precedence over loaded documents. Once this method is invoked,
|
||||
/// document access using this configuration will always map the combination of
|
||||
/// <paramref name="identifier"/> and <see cref="DocumentCategory.Script"/> to the
|
||||
/// <paramref name="identifier"/> and <c><see cref="DocumentCategory.Script"/></c> to the
|
||||
/// specified document, bypassing the configuration's document loader.
|
||||
/// </remarks>
|
||||
public void AddSystemDocument(string identifier, string contents)
|
||||
|
|
|
@ -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;
|
||||
|
@ -8,14 +8,14 @@ using System.Linq;
|
|||
namespace Microsoft.ClearScript
|
||||
{
|
||||
/// <summary>
|
||||
/// Extends <see cref="DynamicObject"/> for enhanced behavior and performance in a scripting environment.
|
||||
/// Extends <c><see cref="DynamicObject"/></c> for enhanced behavior and performance in a scripting environment.
|
||||
/// </summary>
|
||||
public abstract class DynamicHostObject : DynamicObject
|
||||
{
|
||||
// ReSharper disable EmptyConstructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="DynamicHostObject"/> instance.
|
||||
/// Initializes a new <c><see cref="DynamicHostObject"/></c> instance.
|
||||
/// </summary>
|
||||
protected DynamicHostObject()
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define CLEARSCRIPT_VERSION_STRING "7.2.5"
|
||||
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,2,5
|
||||
#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.2.5"
|
||||
#define CLEARSCRIPT_VERSION_STRING "7.3.0"
|
||||
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,3,0
|
||||
#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.3.0"
|
||||
#define CLEARSCRIPT_FILE_FLAGS 0L
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Microsoft.ClearScript
|
|||
/// Connects the host event source to the specified script handler function.
|
||||
/// </summary>
|
||||
/// <param name="scriptFunc">The script function that will handle the event.</param>
|
||||
/// <returns>An <see cref="EventConnection"/> that represents the connection.</returns>
|
||||
/// <returns>An <c><see cref="EventConnection"/></c> that represents the connection.</returns>
|
||||
public EventConnection connect(object scriptFunc)
|
||||
{
|
||||
MiscHelpers.VerifyNonNullArgument(scriptFunc, nameof(scriptFunc));
|
||||
|
@ -79,7 +79,7 @@ namespace Microsoft.ClearScript
|
|||
/// Connects the host event source to the specified script handler function.
|
||||
/// </summary>
|
||||
/// <param name="scriptFunc">The script function that will handle the event.</param>
|
||||
/// <returns>An <see cref="EventConnection{T}"/> that represents the connection.</returns>
|
||||
/// <returns>An <c><see cref="EventConnection{T}"/></c> that represents the connection.</returns>
|
||||
public new EventConnection<T> connect(object scriptFunc)
|
||||
{
|
||||
MiscHelpers.VerifyNonNullArgument(scriptFunc, nameof(scriptFunc));
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -26,7 +26,8 @@ namespace Microsoft.ClearScript
|
|||
|
||||
private static readonly PropertyInfo[] reflectionProperties =
|
||||
{
|
||||
typeof(Delegate).GetProperty("Method")
|
||||
typeof(Delegate).GetProperty("Method"),
|
||||
typeof(Exception).GetProperty("TargetSite")
|
||||
};
|
||||
|
||||
internal static bool EnableVTablePatching;
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Microsoft.ClearScript
|
|||
|
||||
/// <summary>
|
||||
/// Specifies that the host resource's dynamic members are not to be exposed. This option
|
||||
/// applies only to objects that implement <see cref="IDynamicMetaObjectProvider"/>.
|
||||
/// applies only to objects that implement <c><see cref="IDynamicMetaObjectProvider"/></c>.
|
||||
/// </summary>
|
||||
HideDynamicMembers = 0x00000004,
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Microsoft.ClearScript
|
|||
/// "Acme.Gadgets.Button", the corresponding collection will have a property named "Acme" whose
|
||||
/// value is an object with a property named "Gadgets" whose value is an object with a property
|
||||
/// named "Button" whose value represents the <c>Acme.Gadgets.Button</c> host type. Use
|
||||
/// <see cref="ScriptEngine.AddHostObject(string, object)">AddHostObject</see> to expose a host
|
||||
/// <c><see cref="ScriptEngine.AddHostObject(string, object)">AddHostObject</see></c> to expose a host
|
||||
/// type collection to script code.
|
||||
/// </remarks>
|
||||
public class HostTypeCollection : PropertyBag
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Microsoft.ClearScript
|
|||
string Message { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see href="http://en.wikipedia.org/wiki/HRESULT">HRESULT</see> error code if one is available, zero otherwise.
|
||||
/// Gets an <c><see href="http://en.wikipedia.org/wiki/HRESULT">HRESULT</see></c> error code if one is available, zero otherwise.
|
||||
/// </summary>
|
||||
int HResult { get; }
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ namespace Microsoft.ClearScript
|
|||
/// When this attribute is applied to a struct, ClearScript exposes the same object reference
|
||||
/// for all instances of the struct that satisfy equality comparison, giving script code the
|
||||
/// ability to use native equality operators to compare the exposed objects. This behavior is
|
||||
/// also enabled automatically for all enums, numeric types, <see cref="DateTime"/>,
|
||||
/// <see cref="DateTimeOffset"/>, and <see cref="TimeSpan"/>.
|
||||
/// also enabled automatically for all enums, numeric types, <c><see cref="DateTime"/></c>,
|
||||
/// <c><see cref="DateTimeOffset"/></c>, and <c><see cref="TimeSpan"/></c>.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Struct)]
|
||||
public sealed class ImmutableValueAttribute : Attribute
|
||||
|
@ -21,7 +21,7 @@ namespace Microsoft.ClearScript
|
|||
// ReSharper disable EmptyConstructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ImmutableValueAttribute"/> instance.
|
||||
/// Initializes a new <c><see cref="ImmutableValueAttribute"/></c> instance.
|
||||
/// </summary>
|
||||
public ImmutableValueAttribute()
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
{
|
||||
/// <summary>
|
||||
/// Represents a JavaScript
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see>.
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see></c>.
|
||||
/// </summary>
|
||||
public interface IArrayBuffer
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
{
|
||||
/// <summary>
|
||||
/// Defines properties and methods common to all
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see>
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see></c>
|
||||
/// views.
|
||||
/// </summary>
|
||||
public interface IArrayBufferView
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
{
|
||||
/// <summary>
|
||||
/// Represents a JavaScript
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView">DataView</see>.
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView">DataView</see></c>.
|
||||
/// </summary>
|
||||
public interface IDataView : IArrayBufferView
|
||||
{
|
||||
|
|
|
@ -30,47 +30,47 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
/// <term>Interface(s) (C#)</term>
|
||||
/// </listheader>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</see></c></term>
|
||||
/// <term><c>ITypedArray<byte></c></term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray">Uint8ClampedArray</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray">Uint8ClampedArray</see></c></term>
|
||||
/// <term><c>ITypedArray<byte></c></term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array">Int8Array</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array">Int8Array</see></c></term>
|
||||
/// <term><c>ITypedArray<sbyte></c></term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array">Uint16Array</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array">Uint16Array</see></c></term>
|
||||
/// <term><c>ITypedArray<ushort></c> and <c>ITypedArray<char></c></term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array">Int16Array</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array">Int16Array</see></c></term>
|
||||
/// <term><c>ITypedArray<short></c></term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array">Uint32Array</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array">Uint32Array</see></c></term>
|
||||
/// <term><c>ITypedArray<uint></c></term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array">Int32Array</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array">Int32Array</see></c></term>
|
||||
/// <term><c>ITypedArray<int></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><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array">BigUint64Array</see></c></term>
|
||||
/// <term><c>ITypedArray<ulong></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><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array">BigInt64Array</see></c></term>
|
||||
/// <term><c>ITypedArray<long></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><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array">Float32Array</see></c></term>
|
||||
/// <term><c>ITypedArray<float></c></term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array">Float64Array</see></term>
|
||||
/// <term><c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array">Float64Array</see></c></term>
|
||||
/// <term><c>ITypedArray<double></c></term>
|
||||
/// </item>
|
||||
/// </list>
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
public static partial class JavaScriptExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a <see cref="ValueTask{T}"/> instance to a
|
||||
/// Converts a <c><see cref="ValueTask{T}"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code currently running on the calling thread.
|
||||
/// </summary>
|
||||
|
@ -26,7 +26,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="ValueTask{T}"/> instance to a
|
||||
/// Converts a <c><see cref="ValueTask{T}"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code running in the specified script engine.
|
||||
/// </summary>
|
||||
|
@ -52,7 +52,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="ValueTask"/> instance to a
|
||||
/// Converts a <c><see cref="ValueTask"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code currently running on the calling thread.
|
||||
/// </summary>
|
||||
|
@ -67,7 +67,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="ValueTask"/> instance to a
|
||||
/// Converts a <c><see cref="ValueTask"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code running in the specified script engine.
|
||||
/// </summary>
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
public static partial class JavaScriptExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a <see cref="Task{T}"/> instance to a
|
||||
/// Converts a <c><see cref="Task{T}"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code currently running on the calling thread.
|
||||
/// </summary>
|
||||
|
@ -28,7 +28,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="Task{T}"/> instance to a
|
||||
/// Converts a <c><see cref="Task{T}"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code running in the specified script engine.
|
||||
/// </summary>
|
||||
|
@ -51,7 +51,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="Task"/> instance to a
|
||||
/// Converts a <c><see cref="Task"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code currently running on the calling thread.
|
||||
/// </summary>
|
||||
|
@ -63,7 +63,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="Task"/> instance to a
|
||||
/// Converts a <c><see cref="Task"/></c> instance to a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// for use with script code running in the specified script engine.
|
||||
/// </summary>
|
||||
|
@ -87,7 +87,7 @@ namespace Microsoft.ClearScript.JavaScript
|
|||
/// <summary>
|
||||
/// Converts a
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// to a <see cref="Task{Object}"/> instance.
|
||||
/// to a <c><see cref="Task{Object}"/></c> instance.
|
||||
/// </summary>
|
||||
/// <param name="promise">The promise to convert to a task.</param>
|
||||
/// <returns>A task that represents the promise's asynchronous operation.</returns>
|
||||
|
|
|
@ -10,8 +10,8 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This attribute is applicable to classes, enums, interfaces, structs, and assemblies. Use
|
||||
/// <see cref="ScriptUsageAttribute"/>, <see cref="ScriptMemberAttribute"/>, or
|
||||
/// <see cref="NoScriptAccessAttribute"/> to override it for individual type members. Note that
|
||||
/// <c><see cref="ScriptUsageAttribute"/></c>, <c><see cref="ScriptMemberAttribute"/></c>, or
|
||||
/// <c><see cref="NoScriptAccessAttribute"/></c> to override it for individual type members. Note that
|
||||
/// it has no effect on the method binding algorithm. If a script-based call is bound to a
|
||||
/// method that is blocked by this attribute, it will be rejected even if an overload exists
|
||||
/// that could receive the call.
|
||||
|
@ -20,7 +20,7 @@ namespace Microsoft.ClearScript
|
|||
public sealed class NoDefaultScriptAccessAttribute : DefaultScriptUsageAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="NoDefaultScriptAccessAttribute"/> instance.
|
||||
/// Initializes a new <c><see cref="NoDefaultScriptAccessAttribute"/></c> instance.
|
||||
/// </summary>
|
||||
public NoDefaultScriptAccessAttribute()
|
||||
: base(ScriptAccess.None)
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Microsoft.ClearScript
|
|||
public sealed class NoScriptAccessAttribute : ScriptUsageAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="NoScriptAccessAttribute"/> instance.
|
||||
/// Initializes a new <c><see cref="NoScriptAccessAttribute"/></c> instance.
|
||||
/// </summary>
|
||||
public NoScriptAccessAttribute()
|
||||
: base(ScriptAccess.None)
|
||||
|
|
|
@ -18,15 +18,15 @@ using System.Runtime.InteropServices;
|
|||
[assembly: InternalsVisibleTo("ClearScriptTest")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.2.5")]
|
||||
[assembly: AssemblyFileVersion("7.2.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.2.5")]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
||||
|
||||
namespace Microsoft.ClearScript.Properties
|
||||
{
|
||||
internal static class ClearScriptVersion
|
||||
{
|
||||
public const string Triad = "7.2.5";
|
||||
public const string Informational = "7.2.5";
|
||||
public const string Triad = "7.3.0";
|
||||
public const string Informational = "7.3.0";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("ClearScript V8 ICU Data Library")]
|
||||
[assembly: AssemblyProduct("ClearScript")]
|
||||
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
|
||||
[assembly: InternalsVisibleTo("ClearScript.V8")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#@ include file="..\..\Version.tt" #>
|
||||
|
||||
<#@ assembly name="EnvDTE" #>
|
||||
<#@ import namespace="EnvDTE" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="System.Reflection" #>
|
||||
|
||||
<#
|
||||
var dte = (DTE)((IServiceProvider)Host).GetService(typeof(DTE));
|
||||
var solutionPath = Path.GetDirectoryName(dte.Solution.FullName);
|
||||
var keyFilePath = Path.Combine(solutionPath, "ClearScript.snk");
|
||||
var delaySignKeyFilePath = Path.Combine(solutionPath, "ClearScript.DelaySign.snk");
|
||||
var publicKeySpec = string.Empty;
|
||||
if (File.Exists(keyFilePath))
|
||||
{
|
||||
using (var stream = new FileStream(keyFilePath, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
var keyPair = new StrongNameKeyPair(stream);
|
||||
publicKeySpec = ", PublicKey=" + BitConverter.ToString(keyPair.PublicKey).Replace("-", string.Empty);
|
||||
}
|
||||
}
|
||||
else if (File.Exists(delaySignKeyFilePath))
|
||||
{
|
||||
publicKeySpec = ", PublicKey=" + BitConverter.ToString(File.ReadAllBytes(delaySignKeyFilePath)).Replace("-", string.Empty);
|
||||
}
|
||||
#>
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("ClearScript V8 ICU Data Library")]
|
||||
[assembly: AssemblyProduct("ClearScript")]
|
||||
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
|
||||
[assembly: InternalsVisibleTo("<#= "ClearScript.V8" + publicKeySpec #>")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("<#= version.ToString(3) #>")]
|
||||
[assembly: AssemblyFileVersion("<#= version.ToString(3) #>")]
|
||||
[assembly: AssemblyInformationalVersion("<#= version.ToString(3) + versionSuffix #>")]
|
|
@ -15,6 +15,6 @@ using System.Runtime.InteropServices;
|
|||
[assembly: InternalsVisibleTo("ClearScriptTest")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.2.5")]
|
||||
[assembly: AssemblyFileVersion("7.2.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.2.5")]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
||||
|
|
|
@ -16,6 +16,6 @@ using System.Runtime.InteropServices;
|
|||
[assembly: InternalsVisibleTo("ClearScriptTest")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.2.5")]
|
||||
[assembly: AssemblyFileVersion("7.2.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.2.5")]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
||||
|
|
|
@ -15,6 +15,6 @@ using System.Runtime.InteropServices;
|
|||
[assembly: InternalsVisibleTo("ClearScriptTest")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.2.5")]
|
||||
[assembly: AssemblyFileVersion("7.2.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.2.5")]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If an object that implements this interface is added to a script engine (see
|
||||
/// <see cref="ScriptEngine.AddHostObject(string, object)">AddHostObject</see>), script code
|
||||
/// <c><see cref="ScriptEngine.AddHostObject(string, object)">AddHostObject</see></c>), script code
|
||||
/// will be able to access the properties stored in the collection as if they were members of
|
||||
/// the object itself, using the script language's native syntax for member access. No
|
||||
/// other members of the object will be accessible. This interface also allows objects to
|
||||
|
@ -27,7 +27,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a default <see cref="IPropertyBag"/> implementation.
|
||||
/// Provides a default <c><see cref="IPropertyBag"/></c> implementation.
|
||||
/// </summary>
|
||||
public class PropertyBag : IPropertyBag, INotifyPropertyChanged, IScriptableObject
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ namespace Microsoft.ClearScript
|
|||
#region constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new writable <see cref="PropertyBag"/> with the default property name comparer.
|
||||
/// Initializes a new writable <c><see cref="PropertyBag"/></c> with the default property name comparer.
|
||||
/// </summary>
|
||||
public PropertyBag()
|
||||
: this(false)
|
||||
|
@ -51,14 +51,14 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="PropertyBag"/> with the default property name comparer.
|
||||
/// Initializes a new <c><see cref="PropertyBag"/></c> with the default property name comparer.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly"><c>True</c> to make the <see cref="PropertyBag"/> read-only, <c>false</c> to make it writable.</param>
|
||||
/// <param name="isReadOnly"><c>True</c> to make the <c><see cref="PropertyBag"/></c> read-only, <c>false</c> to make it writable.</param>
|
||||
/// <remarks>
|
||||
/// The host can modify a read-only <see cref="PropertyBag"/> by calling
|
||||
/// <see cref="SetPropertyNoCheck">SetPropertyNoCheck</see>,
|
||||
/// <see cref="RemovePropertyNoCheck">RemovePropertyNoCheck</see>, or
|
||||
/// <see cref="ClearNoCheck">ClearNoCheck</see>.
|
||||
/// The host can modify a read-only <c><see cref="PropertyBag"/></c> by calling
|
||||
/// <c><see cref="SetPropertyNoCheck">SetPropertyNoCheck</see></c>,
|
||||
/// <c><see cref="RemovePropertyNoCheck">RemovePropertyNoCheck</see></c>, or
|
||||
/// <c><see cref="ClearNoCheck">ClearNoCheck</see></c>.
|
||||
/// </remarks>
|
||||
public PropertyBag(bool isReadOnly)
|
||||
: this(isReadOnly, null)
|
||||
|
@ -66,7 +66,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new writable <see cref="PropertyBag"/>.
|
||||
/// Initializes a new writable <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
/// <param name="comparer">The comparer to use for property names, or <c>null</c> to use the default string comparer.</param>
|
||||
public PropertyBag(IEqualityComparer<string> comparer)
|
||||
|
@ -75,9 +75,9 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="PropertyBag"/>.
|
||||
/// Initializes a new <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
/// <param name="isReadOnly"><c>True</c> to make the <see cref="PropertyBag"/> read-only, <c>false</c> to make it writable.</param>
|
||||
/// <param name="isReadOnly"><c>True</c> to make the <c><see cref="PropertyBag"/></c> read-only, <c>false</c> to make it writable.</param>
|
||||
/// <param name="comparer">The comparer to use for property names, or <c>null</c> to use the default string comparer.</param>
|
||||
public PropertyBag(bool isReadOnly, IEqualityComparer<string> comparer)
|
||||
{
|
||||
|
@ -91,12 +91,12 @@ namespace Microsoft.ClearScript
|
|||
#region public members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property name comparer for the <see cref="PropertyBag"/>.
|
||||
/// Gets the property name comparer for the <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
public IEqualityComparer<string> Comparer => dictionary.Comparer;
|
||||
|
||||
/// <summary>
|
||||
/// Sets a property value without checking whether the <see cref="PropertyBag"/> is read-only.
|
||||
/// Sets a property value without checking whether the <c><see cref="PropertyBag"/></c> is read-only.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the property to set.</param>
|
||||
/// <param name="value">The property value.</param>
|
||||
|
@ -111,7 +111,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a property without checking whether the <see cref="PropertyBag"/> is read-only.
|
||||
/// Removes a property without checking whether the <c><see cref="PropertyBag"/></c> is read-only.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the property to remove.</param>
|
||||
/// <returns><c>True</c> if the property was found and removed, <c>false</c> otherwise.</returns>
|
||||
|
@ -130,7 +130,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all properties without checking whether the <see cref="PropertyBag"/> is read-only.
|
||||
/// Removes all properties without checking whether the <c><see cref="PropertyBag"/></c> is read-only.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This operation is never exposed to script code.
|
||||
|
@ -250,17 +250,17 @@ namespace Microsoft.ClearScript
|
|||
#region IDictionary<string, object> implementation
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the <see cref="PropertyBag"/> contains a property with the specified name.
|
||||
/// Determines whether the <c><see cref="PropertyBag"/></c> contains a property with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="key">The name of the property to locate.</param>
|
||||
/// <returns><c>True</c> if the <see cref="PropertyBag"/> contains a property with the specified name, <c>false</c> otherwise.</returns>
|
||||
/// <returns><c>True</c> if the <c><see cref="PropertyBag"/></c> contains a property with the specified name, <c>false</c> otherwise.</returns>
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
return dictionary.ContainsKey(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a property to the <see cref="PropertyBag"/>.
|
||||
/// Adds a property to the <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
/// <param name="key">The name of the property to add.</param>
|
||||
/// <param name="value">The property value.</param>
|
||||
|
@ -271,7 +271,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a property from the <see cref="PropertyBag"/>.
|
||||
/// Removes a property from the <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
/// <param name="key">The name of the property to remove.</param>
|
||||
/// <returns><c>True</c> if the property was successfully found and removed, <c>false</c> otherwise.</returns>
|
||||
|
@ -282,7 +282,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a property value in the <see cref="PropertyBag"/>.
|
||||
/// Looks up a property value in the <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
/// <param name="key">The name of the property to locate.</param>
|
||||
/// <param name="value">The property value if the property was found, <c>null</c> otherwise.</param>
|
||||
|
@ -293,7 +293,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a property value in the <see cref="PropertyBag"/>.
|
||||
/// Gets or sets a property value in the <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
/// <param name="key">The name of the property to get or set.</param>
|
||||
/// <returns>The property value.</returns>
|
||||
|
@ -309,12 +309,12 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection of property names from the <see cref="PropertyBag"/>.
|
||||
/// Gets a collection of property names from the <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
public ICollection<string> Keys => dictionary.Keys;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection of property values from the <see cref="PropertyBag"/>.
|
||||
/// Gets a collection of property values from the <c><see cref="PropertyBag"/></c>.
|
||||
/// </summary>
|
||||
public ICollection<object> Values => dictionary.Values;
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace Microsoft.ClearScript
|
|||
/// Gets or sets the default script access setting for all members of exposed objects.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Use <see cref="DefaultScriptUsageAttribute"/>, <see cref="ScriptUsageAttribute"/>, or
|
||||
/// Use <c><see cref="DefaultScriptUsageAttribute"/></c>, <c><see cref="ScriptUsageAttribute"/></c>, or
|
||||
/// their subclasses to override this property for individual types and members. Note that
|
||||
/// this property has no effect on the method binding algorithm. If a script-based call is
|
||||
/// bound to a method that is blocked by this property, it will be rejected even if an
|
||||
|
@ -127,10 +127,10 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Anonymous types are
|
||||
/// <see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/internal">internal</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/internal">internal</see></c>
|
||||
/// and therefore accessible only within the same assembly, but ClearScript 5.5.3 and
|
||||
/// earlier permitted access to the public properties of an object even if its type was
|
||||
/// internal. Newer versions strictly enforce <see cref="AccessContext"/>, but because
|
||||
/// internal. Newer versions strictly enforce <c><see cref="AccessContext"/></c>, but because
|
||||
/// anonymous types are particularly useful for scripting, ClearScript by default continues
|
||||
/// to expose their properties to external contexts. To override this behavior and enable
|
||||
/// normal access restrictions for anonymous types, set this property to <c>true</c>.
|
||||
|
@ -202,10 +202,11 @@ namespace Microsoft.ClearScript
|
|||
/// <remarks>
|
||||
/// When this property is set to <c>true</c>, script code running in the current script
|
||||
/// engine is permitted to use reflection. This affects
|
||||
/// <see cref="System.Object.GetType">Object.GetType()</see>,
|
||||
/// <see cref="System.Exception.GetType">Exception.GetType()</see>,
|
||||
/// <see cref="System.Delegate.Method">Delegate.Method</see>,
|
||||
/// <see cref="HostFunctions.typeOf(object)"/> and <see cref="HostFunctions.typeOf{T}"/>.
|
||||
/// <c><see cref="object.GetType">Object.GetType()</see></c>,
|
||||
/// <c><see cref="Exception.GetType">Exception.GetType()</see></c>,
|
||||
/// <c><see cref="Exception.TargetSite">Exception.TargetSite</see></c>,
|
||||
/// <c><see cref="Delegate.Method">Delegate.Method</see></c>,
|
||||
/// <c><see cref="HostFunctions.typeOf(object)"/></c> and <c><see cref="HostFunctions.typeOf{T}"/></c>.
|
||||
/// By default, any attempt to invoke these members from script code results in an
|
||||
/// exception.
|
||||
/// </remarks>
|
||||
|
@ -220,7 +221,7 @@ namespace Microsoft.ClearScript
|
|||
/// are restricted to their declared types. The default behavior is a general requirement
|
||||
/// for correct method binding, so setting this property to <c>true</c> is not recommended.
|
||||
/// </remarks>
|
||||
/// <seealso cref="ScriptMemberFlags.ExposeRuntimeType"/>
|
||||
/// <c><seealso cref="ScriptMemberFlags.ExposeRuntimeType"/></c>
|
||||
public bool DisableTypeRestriction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -232,7 +233,7 @@ namespace Microsoft.ClearScript
|
|||
/// set this property to <c>true</c> to restore the exemption if you have older script code
|
||||
/// that depends on it.
|
||||
/// </remarks>
|
||||
/// <seealso cref="DisableTypeRestriction"/>
|
||||
/// <c><seealso cref="DisableTypeRestriction"/></c>
|
||||
public bool DisableListIndexTypeRestriction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -245,11 +246,11 @@ namespace Microsoft.ClearScript
|
|||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</see></c>,
|
||||
/// VBScript's
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions//f8tbc79x(v=vs.85)">Nothing</see></c>,
|
||||
/// and other similar values. Instead, use <see cref="HostFunctions.isNull"/> or
|
||||
/// <see cref="object.Equals(object, object)"/> to perform such a comparison.
|
||||
/// and other similar values. Instead, use <c><see cref="HostFunctions.isNull"/></c> or
|
||||
/// <c><see cref="object.Equals(object, object)"/></c> to perform such a comparison.
|
||||
/// </remarks>
|
||||
/// <seealso cref="ScriptMemberFlags.WrapNullResult"/>
|
||||
/// <seealso cref="HostFunctions.isNull"/>
|
||||
/// <c><seealso cref="ScriptMemberFlags.WrapNullResult"/></c>
|
||||
/// <c><seealso cref="HostFunctions.isNull"/></c>
|
||||
public bool EnableNullResultWrapping { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -282,7 +283,7 @@ namespace Microsoft.ClearScript
|
|||
/// arguments to script functions and delegates with host variables, allowing script code
|
||||
/// to simulate output arguments if the script language does not support them natively.
|
||||
/// </remarks>
|
||||
/// <seealso cref="HostFunctions.newVar{T}(T)"/>
|
||||
/// <c><seealso cref="HostFunctions.newVar{T}(T)"/></c>
|
||||
public bool EnableAutoHostVariables { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -292,7 +293,7 @@ namespace Microsoft.ClearScript
|
|||
/// Some script languages support one or more special non-<c>null</c> values that represent
|
||||
/// nonexistent, missing, unknown, or undefined data. When such a value is marshaled to the
|
||||
/// host, the script engine maps it to the value of this property. The default value is
|
||||
/// <see cref="Undefined.Value"/>.
|
||||
/// <c><see cref="Undefined.Value"/></c>.
|
||||
/// </remarks>
|
||||
public object UndefinedImportValue { get; set; } = Undefined.Value;
|
||||
|
||||
|
@ -303,9 +304,9 @@ namespace Microsoft.ClearScript
|
|||
/// Some script languages expect every subroutine call to return a value. When script code
|
||||
/// written in such a language invokes a host method that explicitly returns no value (such
|
||||
/// as a C#
|
||||
/// <see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/void">void</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/void">void</see></c>
|
||||
/// method), the script engine returns the value of this property as a dummy result. The
|
||||
/// default value is <see cref="VoidResult.Value"/>.
|
||||
/// default value is <c><see cref="VoidResult.Value"/></c>.
|
||||
/// </remarks>
|
||||
public object VoidResultValue { get; set; } = VoidResult.Value;
|
||||
|
||||
|
@ -335,8 +336,8 @@ namespace Microsoft.ClearScript
|
|||
/// <remarks>
|
||||
/// The value of this property is an object that is bound to the script engine's root
|
||||
/// namespace. It allows you to access global script resources via the
|
||||
/// <see cref="ScriptObject"/> class interface. Doing so is likely to perform better than
|
||||
/// dynamic access via <see cref="Script"/>.
|
||||
/// <c><see cref="ScriptObject"/></c> class interface. Doing so is likely to perform better than
|
||||
/// dynamic access via <c><see cref="Script"/></c>.
|
||||
/// </remarks>
|
||||
public abstract ScriptObject Global { get; }
|
||||
|
||||
|
@ -356,7 +357,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="target">The object to expose.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddHostObject(string itemName, object target)
|
||||
{
|
||||
|
@ -387,7 +388,7 @@ namespace Microsoft.ClearScript
|
|||
/// <term>N/A</term>
|
||||
/// <description>
|
||||
/// To invoke a constructor from script code, call
|
||||
/// <see cref="HostFunctions.newObj{T}">HostFunctions.newObj(T)</see>.
|
||||
/// <c><see cref="HostFunctions.newObj{T}">HostFunctions.newObj(T)</see></c>.
|
||||
/// </description>
|
||||
/// </item>
|
||||
/// <item>
|
||||
|
@ -428,13 +429,13 @@ namespace Microsoft.ClearScript
|
|||
/// <term><b>Property</b></term>
|
||||
/// <description>
|
||||
/// Indexers appear as properties named "Item" that accept one or more index values
|
||||
/// as arguments. In addition, objects that implement <see cref="IList"/> expose
|
||||
/// as arguments. In addition, objects that implement <c><see cref="IList"/></c> expose
|
||||
/// properties with numeric names that match their valid indices. This includes
|
||||
/// one-dimensional host arrays and other collections. Multidimensional host arrays
|
||||
/// do not expose functional indexers; you must use
|
||||
/// <see href="https://docs.microsoft.com/en-us/dotnet/api/system.array.getvalue">Array.GetValue</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/dotnet/api/system.array.getvalue">Array.GetValue</see></c>
|
||||
/// and
|
||||
/// <see href="https://docs.microsoft.com/en-us/dotnet/api/system.array.setvalue">Array.SetValue</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/dotnet/api/system.array.setvalue">Array.SetValue</see></c>
|
||||
/// instead.
|
||||
/// </description>
|
||||
/// </item>
|
||||
|
@ -442,7 +443,7 @@ namespace Microsoft.ClearScript
|
|||
/// <term><b>Event</b></term>
|
||||
/// <term><b>Property</b></term>
|
||||
/// <description>
|
||||
/// Events are exposed as read-only properties of type <see cref="EventSource{T}"/>.
|
||||
/// Events are exposed as read-only properties of type <c><see cref="EventSource{T}"/></c>.
|
||||
/// </description>
|
||||
/// </item>
|
||||
/// </list>
|
||||
|
@ -467,7 +468,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddRestrictedHostObject<T>(string itemName, T target)
|
||||
|
@ -489,7 +490,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddRestrictedHostObject<T>(string itemName, HostItemFlags flags, T target)
|
||||
|
@ -510,7 +511,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, string progID)
|
||||
|
@ -532,7 +533,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, string progID, string serverName)
|
||||
|
@ -554,7 +555,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, HostItemFlags flags, string progID)
|
||||
|
@ -577,7 +578,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, HostItemFlags flags, string progID, string serverName)
|
||||
|
@ -593,7 +594,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="clsid">The class identifier (CLSID) of the registered class to instantiate.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, Guid clsid)
|
||||
{
|
||||
|
@ -609,7 +610,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="serverName">The name of the server on which to create the object.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, Guid clsid, string serverName)
|
||||
{
|
||||
|
@ -625,7 +626,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="clsid">The class identifier (CLSID) of the registered class to instantiate.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, HostItemFlags flags, Guid clsid)
|
||||
{
|
||||
|
@ -642,7 +643,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="serverName">The name of the server on which to create the object.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMObject(string itemName, HostItemFlags flags, Guid clsid, string serverName)
|
||||
{
|
||||
|
@ -666,7 +667,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(Type type)
|
||||
|
@ -692,7 +693,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(HostItemFlags flags, Type type)
|
||||
|
@ -714,7 +715,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(string itemName, Type type)
|
||||
|
@ -737,7 +738,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(string itemName, HostItemFlags flags, Type type)
|
||||
|
@ -761,7 +762,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(string itemName, string typeName, params Type[] typeArgs)
|
||||
|
@ -785,7 +786,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(string itemName, HostItemFlags flags, string typeName, params Type[] typeArgs)
|
||||
|
@ -809,7 +810,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(string itemName, string typeName, string assemblyName, params Type[] typeArgs)
|
||||
|
@ -835,7 +836,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostType(string itemName, HostItemFlags flags, string typeName, string assemblyName, params Type[] typeArgs)
|
||||
|
@ -860,7 +861,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For more information about the mapping between host members and script-callable
|
||||
/// properties and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// properties and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddHostTypes(params Type[] types)
|
||||
|
@ -890,7 +891,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, string progID)
|
||||
|
@ -912,7 +913,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, string progID, string serverName)
|
||||
|
@ -934,7 +935,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, HostItemFlags flags, string progID)
|
||||
|
@ -957,7 +958,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, HostItemFlags flags, string progID, string serverName)
|
||||
|
@ -973,7 +974,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="clsid">The class identifier (CLSID) of the registered class to import.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, Guid clsid)
|
||||
{
|
||||
|
@ -989,7 +990,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="serverName">The name of the server from which to import the type.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, Guid clsid, string serverName)
|
||||
{
|
||||
|
@ -1005,7 +1006,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="clsid">The class identifier (CLSID) of the registered class to import.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, HostItemFlags flags, Guid clsid)
|
||||
{
|
||||
|
@ -1022,7 +1023,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="serverName">The name of the server from which to import the type.</param>
|
||||
/// <remarks>
|
||||
/// For information about the mapping between host members and script-callable properties
|
||||
/// and methods, see <see cref="AddHostObject(string, HostItemFlags, object)"/>.
|
||||
/// and methods, see <c><see cref="AddHostObject(string, HostItemFlags, object)"/></c>.
|
||||
/// </remarks>
|
||||
public void AddCOMType(string itemName, HostItemFlags flags, Guid clsid, string serverName)
|
||||
{
|
||||
|
@ -1163,7 +1164,7 @@ namespace Microsoft.ClearScript
|
|||
/// <param name="command">The script command to execute.</param>
|
||||
/// <returns>The command output.</returns>
|
||||
/// <remarks>
|
||||
/// This method is similar to <see cref="Evaluate(string)"/> but optimized for command
|
||||
/// This method is similar to <c><see cref="Evaluate(string)"/></c> but optimized for command
|
||||
/// consoles. The specified command must be limited to a single expression or statement.
|
||||
/// Script engines can override this method to customize command execution as well as the
|
||||
/// process of converting the result to a string for console output.
|
||||
|
@ -1192,7 +1193,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the types of result values that script code can return, see
|
||||
/// <see cref="Evaluate(string, bool, string)"/>.
|
||||
/// <c><see cref="Evaluate(string, bool, string)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public object Evaluate(string code)
|
||||
|
@ -1218,7 +1219,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the types of result values that script code can return, see
|
||||
/// <see cref="Evaluate(string, bool, string)"/>.
|
||||
/// <c><see cref="Evaluate(string, bool, string)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public object Evaluate(string documentName, string code)
|
||||
|
@ -1255,17 +1256,17 @@ namespace Microsoft.ClearScript
|
|||
/// </listheader>
|
||||
/// <item>
|
||||
/// <term><b>String</b></term>
|
||||
/// <term><see href="https://docs.microsoft.com/en-us/dotnet/api/system.string">System.String</see></term>
|
||||
/// <term><c><see href="https://docs.microsoft.com/en-us/dotnet/api/system.string">System.String</see></c></term>
|
||||
/// <description>N/A</description>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><b>Boolean</b></term>
|
||||
/// <term><see href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">System.Boolean</see></term>
|
||||
/// <term><c><see href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">System.Boolean</see></c></term>
|
||||
/// <description>N/A</description>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><b>Number</b></term>
|
||||
/// <term><see href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">System.Int32</see> or <see href="https://docs.microsoft.com/en-us/dotnet/api/system.double">System.Double</see></term>
|
||||
/// <term><c><see href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">System.Int32</see></c> or <c><see href="https://docs.microsoft.com/en-us/dotnet/api/system.double">System.Double</see></c></term>
|
||||
/// <description>
|
||||
/// Other numeric types are possible. The exact conversions between script and .NET
|
||||
/// numeric types are defined by the script engine.
|
||||
|
@ -1278,18 +1279,18 @@ namespace Microsoft.ClearScript
|
|||
/// </item>
|
||||
/// <item>
|
||||
/// <term><b>Undefined</b></term>
|
||||
/// <term><see cref="Undefined"/></term>
|
||||
/// <term><c><see cref="Undefined"/></c></term>
|
||||
/// <description>
|
||||
/// This represents JavaScript's
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</see>,
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</see></c>,
|
||||
/// VBScript's
|
||||
/// <see href="https://docs.microsoft.com/en-us/previous-versions//f8tbc79x(v=vs.85)">Empty</see>,
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions//f8tbc79x(v=vs.85)">Empty</see></c>,
|
||||
/// etc.
|
||||
/// </description>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term><b>Void</b></term>
|
||||
/// <term><see cref="VoidResult"/></term>
|
||||
/// <term><c><see cref="VoidResult"/></c></term>
|
||||
/// <description>
|
||||
/// This is returned when script code forwards the result of a host method that returns no value.
|
||||
/// </description>
|
||||
|
@ -1306,10 +1307,10 @@ namespace Microsoft.ClearScript
|
|||
/// </item>
|
||||
/// <item>
|
||||
/// <term><b>Script Object</b></term>
|
||||
/// <term><see cref="ScriptObject"/></term>
|
||||
/// <term><c><see cref="ScriptObject"/></c></term>
|
||||
/// <description>
|
||||
/// This includes all native script objects that have no .NET representation. C#'s
|
||||
/// <see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/reference-types#the-dynamic-type">dynamic</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/reference-types#the-dynamic-type">dynamic</see></c>
|
||||
/// keyword provides a convenient way to access them.
|
||||
/// </description>
|
||||
/// </item>
|
||||
|
@ -1344,7 +1345,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the types of result values that script code can return, see
|
||||
/// <see cref="Evaluate(string, bool, string)"/>.
|
||||
/// <c><see cref="Evaluate(string, bool, string)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public object Evaluate(DocumentInfo documentInfo, string code)
|
||||
|
@ -1365,7 +1366,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the types of result values that script code can return, see
|
||||
/// <see cref="Evaluate(string, bool, string)"/>.
|
||||
/// <c><see cref="Evaluate(string, bool, string)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public object EvaluateDocument(string specifier)
|
||||
|
@ -1387,7 +1388,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the types of result values that script code can return, see
|
||||
/// <see cref="Evaluate(string, bool, string)"/>.
|
||||
/// <c><see cref="Evaluate(string, bool, string)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public object EvaluateDocument(string specifier, DocumentCategory category)
|
||||
|
@ -1410,7 +1411,7 @@ namespace Microsoft.ClearScript
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// For information about the types of result values that script code can return, see
|
||||
/// <see cref="Evaluate(string, bool, string)"/>.
|
||||
/// <c><see cref="Evaluate(string, bool, string)"/></c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public object EvaluateDocument(string specifier, DocumentCategory category, DocumentContextCallback contextCallback)
|
||||
|
@ -2004,10 +2005,10 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <param name="disposing"><c>True</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
/// <remarks>
|
||||
/// This method is called by the public <see cref="Dispose()"/> method and the
|
||||
/// <see cref="Finalize">Finalize</see> method. <see cref="Dispose()"/> invokes the
|
||||
/// This method is called by the public <c><see cref="Dispose()"/></c> method and the
|
||||
/// <c><see cref="Finalize">Finalize</see></c> method. <c><see cref="Dispose()"/></c> invokes the
|
||||
/// protected <c>Dispose(Boolean)</c> method with the <paramref name="disposing"/>
|
||||
/// parameter set to <c>true</c>. <see cref="Finalize">Finalize</see> invokes
|
||||
/// parameter set to <c>true</c>. <c><see cref="Finalize">Finalize</see></c> invokes
|
||||
/// <c>Dispose(Boolean)</c> with <paramref name="disposing"/> set to <c>false</c>.
|
||||
/// </remarks>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
|
@ -2022,10 +2023,10 @@ namespace Microsoft.ClearScript
|
|||
/// Releases unmanaged resources and performs other cleanup operations before the script engine is reclaimed by garbage collection.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method overrides <see cref="System.Object.Finalize"/>. Application code should not
|
||||
/// This method overrides <c><see cref="System.Object.Finalize"/></c>. Application code should not
|
||||
/// call this method; an object's <c>Finalize()</c> method is automatically invoked during
|
||||
/// garbage collection, unless finalization by the garbage collector has been disabled by a
|
||||
/// call to <see cref="System.GC.SuppressFinalize"/>.
|
||||
/// call to <c><see cref="System.GC.SuppressFinalize"/></c>.
|
||||
/// </remarks>
|
||||
~ScriptEngine()
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Microsoft.ClearScript
|
|||
#region constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptEngineException"/> instance.
|
||||
/// Initializes a new <c><see cref="ScriptEngineException"/></c> instance.
|
||||
/// </summary>
|
||||
public ScriptEngineException()
|
||||
: base(defaultMessage)
|
||||
|
@ -40,7 +40,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptEngineException"/> with the specified error message.
|
||||
/// Initializes a new <c><see cref="ScriptEngineException"/></c> with the specified error message.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message.</param>
|
||||
public ScriptEngineException(string message)
|
||||
|
@ -50,7 +50,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptEngineException"/> with the specified error message and nested exception.
|
||||
/// Initializes a new <c><see cref="ScriptEngineException"/></c> with the specified error message and nested exception.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message.</param>
|
||||
/// <param name="innerException">The exception that caused the current exception to be thrown.</param>
|
||||
|
@ -61,7 +61,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptEngineException"/> with serialized data.
|
||||
/// Initializes a new <c><see cref="ScriptEngineException"/></c> with serialized data.
|
||||
/// </summary>
|
||||
/// <param name="info">The object that holds the serialized data.</param>
|
||||
/// <param name="context">The contextual information about the source or destination.</param>
|
||||
|
@ -94,7 +94,7 @@ namespace Microsoft.ClearScript
|
|||
#region IScriptEngineException implementation
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see href="http://en.wikipedia.org/wiki/HRESULT">HRESULT</see> error code if one is available, zero otherwise.
|
||||
/// Gets an <c><see href="http://en.wikipedia.org/wiki/HRESULT">HRESULT</see></c> error code if one is available, zero otherwise.
|
||||
/// </summary>
|
||||
int IScriptEngineException.HResult => HResult;
|
||||
|
||||
|
@ -149,10 +149,10 @@ namespace Microsoft.ClearScript
|
|||
#region InvalidOperationException overrides
|
||||
|
||||
/// <summary>
|
||||
/// Populates a <see cref="SerializationInfo"/> with the data needed to serialize the target object.
|
||||
/// Populates a <c><see cref="SerializationInfo"/></c> with the data needed to serialize the target object.
|
||||
/// </summary>
|
||||
/// <param name="info">The <see cref="SerializationInfo"/> to populate with data.</param>
|
||||
/// <param name="context">The destination (see <see cref="StreamingContext"/>) for this serialization.</param>
|
||||
/// <param name="info">The <c><see cref="SerializationInfo"/></c> to populate with data.</param>
|
||||
/// <param name="context">The destination (see <c><see cref="StreamingContext"/></c>) for this serialization.</param>
|
||||
public override void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
base.GetObjectData(info, context);
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Microsoft.ClearScript
|
|||
#region constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptInterruptedException"/> instance.
|
||||
/// Initializes a new <c><see cref="ScriptInterruptedException"/></c> instance.
|
||||
/// </summary>
|
||||
public ScriptInterruptedException()
|
||||
: base(defaultMessage)
|
||||
|
@ -40,7 +40,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptInterruptedException"/> with the specified error message.
|
||||
/// Initializes a new <c><see cref="ScriptInterruptedException"/></c> with the specified error message.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message.</param>
|
||||
public ScriptInterruptedException(string message)
|
||||
|
@ -50,7 +50,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptInterruptedException"/> with the specified error message and nested exception.
|
||||
/// Initializes a new <c><see cref="ScriptInterruptedException"/></c> with the specified error message and nested exception.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message.</param>
|
||||
/// <param name="innerException">The exception that caused the current exception to be thrown.</param>
|
||||
|
@ -61,7 +61,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptInterruptedException"/> with serialized data.
|
||||
/// Initializes a new <c><see cref="ScriptInterruptedException"/></c> with serialized data.
|
||||
/// </summary>
|
||||
/// <param name="info">The object that holds the serialized data.</param>
|
||||
/// <param name="context">The contextual information about the source or destination.</param>
|
||||
|
@ -94,7 +94,7 @@ namespace Microsoft.ClearScript
|
|||
#region IScriptEngineException implementation
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see href="http://en.wikipedia.org/wiki/HRESULT">HRESULT</see> error code if one is available, zero otherwise.
|
||||
/// Gets an <c><see href="http://en.wikipedia.org/wiki/HRESULT">HRESULT</see></c> error code if one is available, zero otherwise.
|
||||
/// </summary>
|
||||
int IScriptEngineException.HResult => HResult;
|
||||
|
||||
|
@ -149,10 +149,10 @@ namespace Microsoft.ClearScript
|
|||
#region OperationCanceledException overrides
|
||||
|
||||
/// <summary>
|
||||
/// Populates a <see cref="SerializationInfo"/> with the data needed to serialize the target object.
|
||||
/// Populates a <c><see cref="SerializationInfo"/></c> with the data needed to serialize the target object.
|
||||
/// </summary>
|
||||
/// <param name="info">The <see cref="SerializationInfo"/> to populate with data.</param>
|
||||
/// <param name="context">The destination (see <see cref="StreamingContext"/>) for this serialization.</param>
|
||||
/// <param name="info">The <c><see cref="SerializationInfo"/></c> to populate with data.</param>
|
||||
/// <param name="context">The destination (see <c><see cref="StreamingContext"/></c>) for this serialization.</param>
|
||||
public override void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
base.GetObjectData(info, context);
|
||||
|
|
|
@ -16,14 +16,14 @@ namespace Microsoft.ClearScript
|
|||
public sealed class ScriptMemberAttribute : ScriptUsageAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance.
|
||||
/// </summary>
|
||||
public ScriptMemberAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance with the specified name.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">The name that script code will use to access the target type member.</param>
|
||||
public ScriptMemberAttribute(string name)
|
||||
|
@ -32,7 +32,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance with the specified script access setting.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance with the specified script access setting.
|
||||
/// </summary>
|
||||
/// <param name="access">The script access setting for the target type member.</param>
|
||||
public ScriptMemberAttribute(ScriptAccess access)
|
||||
|
@ -41,7 +41,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance with the specified name and script access setting.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance with the specified name and script access setting.
|
||||
/// </summary>
|
||||
/// <param name="name">The name that script code will use to access the target type member.</param>
|
||||
/// <param name="access">The script access setting for the target type member.</param>
|
||||
|
@ -52,7 +52,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance with the specified script options.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance with the specified script options.
|
||||
/// </summary>
|
||||
/// <param name="flags">The script options for the target type member.</param>
|
||||
public ScriptMemberAttribute(ScriptMemberFlags flags)
|
||||
|
@ -61,7 +61,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance with the specified name and script options.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance with the specified name and script options.
|
||||
/// </summary>
|
||||
/// <param name="name">The name that script code will use to access the target type member.</param>
|
||||
/// <param name="flags">The script options for the target type member.</param>
|
||||
|
@ -72,7 +72,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance with the specified script access setting and script options.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance with the specified script access setting and script options.
|
||||
/// </summary>
|
||||
/// <param name="access">The script access setting for the target type member.</param>
|
||||
/// <param name="flags">The script options for the target type member.</param>
|
||||
|
@ -83,7 +83,7 @@ namespace Microsoft.ClearScript
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptMemberAttribute"/> instance with the specified name, script access setting, and script options.
|
||||
/// Initializes a new <c><see cref="ScriptMemberAttribute"/></c> instance with the specified name, script access setting, and script options.
|
||||
/// </summary>
|
||||
/// <param name="name">The name that script code will use to access the target type member.</param>
|
||||
/// <param name="access">The script access setting for the target type member.</param>
|
||||
|
|
|
@ -29,8 +29,8 @@ namespace Microsoft.ClearScript
|
|||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</see></c>,
|
||||
/// VBScript's
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions//f8tbc79x(v=vs.85)">Nothing</see></c>,
|
||||
/// and other similar values. Instead, use <see cref="HostFunctions.isNull"/> or
|
||||
/// <see cref="object.Equals(object, object)"/> to perform such a comparison.
|
||||
/// and other similar values. Instead, use <c><see cref="HostFunctions.isNull"/></c> or
|
||||
/// <c><see cref="object.Equals(object, object)"/></c> to perform such a comparison.
|
||||
/// </summary>
|
||||
WrapNullResult = 0x00000002
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using Microsoft.ClearScript.Util;
|
||||
|
@ -8,7 +8,7 @@ namespace Microsoft.ClearScript
|
|||
/// <summary>
|
||||
/// Represents a script object.
|
||||
/// </summary>
|
||||
/// <seealso cref="ScriptEngine.Evaluate(string, bool, string)"/>
|
||||
/// <c><seealso cref="ScriptEngine.Evaluate(string, bool, string)"/></c>
|
||||
public abstract class ScriptObject : DynamicObject
|
||||
{
|
||||
internal ScriptObject()
|
||||
|
|
|
@ -15,14 +15,14 @@ namespace Microsoft.ClearScript
|
|||
public class ScriptUsageAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptUsageAttribute"/> instance.
|
||||
/// Initializes a new <c><see cref="ScriptUsageAttribute"/></c> instance.
|
||||
/// </summary>
|
||||
public ScriptUsageAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="ScriptUsageAttribute"/> instance with the specified script access setting.
|
||||
/// Initializes a new <c><see cref="ScriptUsageAttribute"/></c> instance with the specified script access setting.
|
||||
/// </summary>
|
||||
/// <param name="access">The script access setting for the target type member.</param>
|
||||
public ScriptUsageAttribute(ScriptAccess access)
|
||||
|
|
|
@ -7,14 +7,14 @@ using System.Text;
|
|||
namespace Microsoft.ClearScript
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides an in-memory <see cref="Document"/> implementation for a text document.
|
||||
/// Provides an in-memory <c><see cref="Document"/></c> implementation for a text document.
|
||||
/// </summary>
|
||||
public class StringDocument : Document
|
||||
{
|
||||
private readonly byte[] contents;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="StringDocument"/> instance.
|
||||
/// Initializes a new <c><see cref="StringDocument"/></c> instance.
|
||||
/// </summary>
|
||||
/// <param name="info">A structure containing meta-information for the document.</param>
|
||||
/// <param name="contents">A string containing the document's contents.</param>
|
||||
|
@ -35,8 +35,8 @@ namespace Microsoft.ClearScript
|
|||
/// Gets a stream that provides read access to the document.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The <see cref="StringDocument"/> implementation of this property returns a
|
||||
/// <see cref="MemoryStream"/> instance.
|
||||
/// The <c><see cref="StringDocument"/></c> implementation of this property returns a
|
||||
/// <c><see cref="MemoryStream"/></c> instance.
|
||||
/// </remarks>
|
||||
public override Stream Contents => new MemoryStream(contents, false);
|
||||
|
||||
|
@ -44,7 +44,7 @@ namespace Microsoft.ClearScript
|
|||
/// Gets the document's character encoding.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="StringDocument"/> instances return <see cref="System.Text.Encoding.UTF8"/> for this property.
|
||||
/// <c><see cref="StringDocument"/></c> instances return <c><see cref="System.Text.Encoding.UTF8"/></c> for this property.
|
||||
/// </remarks>
|
||||
public override Encoding Encoding => Encoding.UTF8;
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ namespace Microsoft.ClearScript
|
|||
/// nonexistent, missing, unknown, or undefined data. The ClearScript library maps such values
|
||||
/// to an instance of this class.
|
||||
/// </remarks>
|
||||
/// <seealso cref="ScriptEngine.UndefinedImportValue"/>
|
||||
/// <c><seealso cref="ScriptEngine.UndefinedImportValue"/></c>
|
||||
public class Undefined
|
||||
{
|
||||
/// <summary>
|
||||
/// The sole instance of the <see cref="Undefined"/> class.
|
||||
/// The sole instance of the <c><see cref="Undefined"/></c> class.
|
||||
/// </summary>
|
||||
public static readonly Undefined Value = new Undefined();
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
/// <remarks>
|
||||
/// The <see cref="Undefined"/> version of this method returns "[undefined]".
|
||||
/// The <c><see cref="Undefined"/></c> version of this method returns "[undefined]".
|
||||
/// </remarks>
|
||||
public override string ToString()
|
||||
{
|
||||
|
|
|
@ -41,8 +41,7 @@ namespace Microsoft.ClearScript.Util
|
|||
return false;
|
||||
}
|
||||
|
||||
obj = Activator.CreateInstance(type) as T;
|
||||
return obj != null;
|
||||
return Try(out obj, () => Activator.CreateInstance(type) as T) && (obj != null);
|
||||
}
|
||||
|
||||
public static bool TryCreateCOMObject<T>(Guid clsid, string serverName, out T obj) where T : class
|
||||
|
@ -53,8 +52,7 @@ namespace Microsoft.ClearScript.Util
|
|||
return false;
|
||||
}
|
||||
|
||||
obj = Activator.CreateInstance(type) as T;
|
||||
return obj != null;
|
||||
return Try(out obj, () => Activator.CreateInstance(type) as T) && (obj != null);
|
||||
}
|
||||
|
||||
public static Type GetCOMType(string progID, string serverName)
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.ClearScript.V8.ICUData
|
||||
{
|
||||
internal static class V8ICUData
|
||||
{
|
||||
public const string ResourceName = "Microsoft.ClearScript.V8.ICUData.icudtl.dat";
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
IntPtr V8SplitProxyManaged_SetMethodTable(IntPtr pMethodTable);
|
||||
|
||||
void V8Environment_InitializeICU(string dataPath);
|
||||
void V8Environment_InitializeICU(IntPtr pICUData, uint size);
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -128,7 +128,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
#region V8 isolate methods
|
||||
|
||||
V8Isolate.Handle V8Isolate_Create(string name, int maxNewSpaceSize, int maxOldSpaceSize, double heapExpansionMultiplier, ulong maxArrayBufferAllocation, bool enableDebugging, bool enableRemoteDebugging, bool enableDynamicModuleImports, int debugPort);
|
||||
V8Context.Handle V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort);
|
||||
V8Context.Handle V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort);
|
||||
UIntPtr V8Isolate_GetMaxHeapSize(V8Isolate.Handle hIsolate);
|
||||
void V8Isolate_SetMaxHeapSize(V8Isolate.Handle hIsolate, UIntPtr size);
|
||||
double V8Isolate_GetHeapSizeSampleInterval(V8Isolate.Handle hIsolate);
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
flags.HasFlag(V8ScriptEngineFlags.DisableGlobalMembers),
|
||||
flags.HasFlag(V8ScriptEngineFlags.EnableDateTimeConversion),
|
||||
flags.HasFlag(V8ScriptEngineFlags.EnableDynamicModuleImports),
|
||||
flags.HasFlag(V8ScriptEngineFlags.HideHostExceptions),
|
||||
debugPort
|
||||
));
|
||||
}
|
||||
|
|
|
@ -65,9 +65,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -450,11 +450,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1080,7 +1080,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -1506,6 +1507,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
|
|
@ -107,9 +107,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -492,11 +492,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1122,7 +1122,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -1548,6 +1549,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -2135,9 +2137,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -2520,11 +2522,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3150,7 +3152,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -3576,6 +3579,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -4163,9 +4167,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -4548,11 +4552,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5178,7 +5182,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -5604,6 +5609,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -6191,9 +6197,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -6576,11 +6582,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7206,7 +7212,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -7632,6 +7639,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -8219,9 +8227,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -8604,11 +8612,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9234,7 +9242,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -9660,6 +9669,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -10247,9 +10257,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -10632,11 +10642,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11262,7 +11272,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -11688,6 +11699,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -12275,9 +12287,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -12660,11 +12672,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13290,7 +13302,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -13716,6 +13729,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -14303,9 +14317,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -14688,11 +14702,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15318,7 +15332,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -15744,6 +15759,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
|
|
@ -63,9 +63,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -448,11 +448,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1078,7 +1078,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -1504,6 +1505,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -2091,9 +2093,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -2476,11 +2478,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3106,7 +3108,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -3532,6 +3535,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
@ -4119,9 +4123,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
return V8SplitProxyManaged_SetMethodTable(pMethodTable);
|
||||
}
|
||||
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(string dataPath)
|
||||
void IV8SplitProxyNative.V8Environment_InitializeICU(IntPtr pICUData, uint size)
|
||||
{
|
||||
V8Environment_InitializeICU(dataPath);
|
||||
V8Environment_InitializeICU(pICUData, size);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -4504,11 +4508,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
}
|
||||
}
|
||||
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, int debugPort)
|
||||
V8Context.Handle IV8SplitProxyNative.V8Isolate_CreateContext(V8Isolate.Handle hIsolate, string name, bool enableDebugging, bool enableRemoteDebugging, bool disableGlobalMembers, bool enableDateTimeConversion, bool enableDynamicModuleImports, bool hideHostExceptions, int debugPort)
|
||||
{
|
||||
using (var nameScope = StdString.CreateScope(name))
|
||||
{
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, debugPort);
|
||||
return V8Isolate_CreateContext(hIsolate, nameScope.Value, enableDebugging, enableRemoteDebugging, disableGlobalMembers, enableDateTimeConversion, enableDynamicModuleImports, hideHostExceptions, debugPort);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5134,7 +5138,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
|
||||
[DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)]
|
||||
private static extern void V8Environment_InitializeICU(
|
||||
[In] [MarshalAs(UnmanagedType.LPWStr)] string dataPath
|
||||
[In] IntPtr pICUData,
|
||||
[In] uint size
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
@ -5560,6 +5565,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy
|
|||
[In] [MarshalAs(UnmanagedType.I1)] bool disableGlobalMembers,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDateTimeConversion,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool enableDynamicModuleImports,
|
||||
[In] [MarshalAs(UnmanagedType.I1)] bool hideHostExceptions,
|
||||
[In] int debugPort
|
||||
);
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <remarks>
|
||||
/// A value of zero indicates that no line number is available.
|
||||
/// </remarks>
|
||||
/// <seealso cref="V8CpuProfileFlags"/>
|
||||
/// <c><seealso cref="V8CpuProfileFlags"/></c>
|
||||
public long LineNumber { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -206,7 +206,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <remarks>
|
||||
/// A value of zero indicates that no column number is available.
|
||||
/// </remarks>
|
||||
/// <seealso cref="V8CpuProfileFlags"/>
|
||||
/// <c><seealso cref="V8CpuProfileFlags"/></c>
|
||||
public long ColumnNumber { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -3,11 +3,13 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Microsoft.ClearScript.Util;
|
||||
using Microsoft.ClearScript.V8.ICUData;
|
||||
using Microsoft.ClearScript.V8.SplitProxy;
|
||||
|
||||
namespace Microsoft.ClearScript.V8
|
||||
|
@ -18,15 +20,36 @@ namespace Microsoft.ClearScript.V8
|
|||
|
||||
private static IntPtr hNativeAssembly;
|
||||
private static ulong splitImplCount;
|
||||
private static bool triedToLoadNativeAssembly;
|
||||
private static bool loadedNativeAssembly;
|
||||
|
||||
internal static bool OnEntityHolderCreated()
|
||||
{
|
||||
lock (dataLock)
|
||||
{
|
||||
if (hNativeAssembly == IntPtr.Zero)
|
||||
if (!triedToLoadNativeAssembly)
|
||||
{
|
||||
hNativeAssembly = LoadNativeAssembly();
|
||||
InitializeICU();
|
||||
triedToLoadNativeAssembly = true;
|
||||
var initializedICU = false;
|
||||
|
||||
try
|
||||
{
|
||||
hNativeAssembly = LoadNativeAssembly();
|
||||
loadedNativeAssembly = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
initializedICU = MiscHelpers.Try(InitializeICU);
|
||||
if (!initializedICU)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
if (!initializedICU)
|
||||
{
|
||||
InitializeICU();
|
||||
}
|
||||
}
|
||||
|
||||
++splitImplCount;
|
||||
|
@ -38,10 +61,11 @@ namespace Microsoft.ClearScript.V8
|
|||
{
|
||||
lock (dataLock)
|
||||
{
|
||||
if (--splitImplCount < 1)
|
||||
if ((--splitImplCount < 1) && loadedNativeAssembly)
|
||||
{
|
||||
FreeLibrary(hNativeAssembly);
|
||||
hNativeAssembly = IntPtr.Zero;
|
||||
loadedNativeAssembly = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,14 +123,12 @@ namespace Microsoft.ClearScript.V8
|
|||
private static IntPtr LoadNativeLibrary(string baseName, string platform, string architecture, string extension)
|
||||
{
|
||||
var fileName = $"{baseName}.{platform}-{architecture}.{extension}";
|
||||
|
||||
IntPtr hLibrary;
|
||||
var messageBuilder = new StringBuilder();
|
||||
|
||||
var paths = GetDirPaths(platform, architecture).Select(dirPath => Path.Combine(dirPath, deploymentDirName, fileName)).Distinct();
|
||||
var paths = GetDirPaths(platform, architecture).Select(dirPath => Path.Combine(dirPath, fileName)).Distinct();
|
||||
foreach (var path in paths)
|
||||
{
|
||||
hLibrary = LoadLibrary(path);
|
||||
var hLibrary = LoadLibrary(path);
|
||||
if (hLibrary != IntPtr.Zero)
|
||||
{
|
||||
return hLibrary;
|
||||
|
@ -115,49 +137,25 @@ namespace Microsoft.ClearScript.V8
|
|||
messageBuilder.AppendInvariant("\n{0}: {1}", path, MiscHelpers.EnsureNonBlank(GetLoadLibraryErrorMessage(), "Unknown error"));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(deploymentDirName))
|
||||
{
|
||||
var systemPath = Path.Combine(Environment.SystemDirectory, fileName);
|
||||
hLibrary = LoadLibrary(systemPath);
|
||||
if (hLibrary != IntPtr.Zero)
|
||||
{
|
||||
return hLibrary;
|
||||
}
|
||||
|
||||
messageBuilder.AppendInvariant("\n{0}: {1}", systemPath, MiscHelpers.EnsureNonBlank(GetLoadLibraryErrorMessage(), "Unknown error"));
|
||||
}
|
||||
|
||||
var message = MiscHelpers.FormatInvariant("Cannot load ClearScript V8 library. Load failure information for {0}:{1}", fileName, messageBuilder);
|
||||
throw new TypeLoadException(message);
|
||||
}
|
||||
|
||||
private static void InitializeICU()
|
||||
private static unsafe void InitializeICU()
|
||||
{
|
||||
// ReSharper disable RedundantJumpStatement
|
||||
|
||||
const string fileName = "ClearScriptV8.ICU.dat";
|
||||
|
||||
var paths = GetDirPaths(null, null).Select(dirPath => Path.Combine(dirPath, deploymentDirName, fileName)).Distinct();
|
||||
foreach (var path in paths)
|
||||
using (var stream = typeof(V8ICUData).Assembly.GetManifestResourceStream(V8ICUData.ResourceName))
|
||||
{
|
||||
if (File.Exists(path))
|
||||
var bytes = new byte[stream.Length];
|
||||
|
||||
var length = stream.Read(bytes, 0, bytes.Length);
|
||||
Debug.Assert(length == bytes.Length);
|
||||
|
||||
fixed (byte* pBytes = bytes)
|
||||
{
|
||||
V8SplitProxyNative.InvokeNoThrow(instance => instance.V8Environment_InitializeICU(path));
|
||||
return;
|
||||
var pICUData = (IntPtr)pBytes;
|
||||
V8SplitProxyNative.InvokeNoThrow(instance => instance.V8Environment_InitializeICU(pICUData, Convert.ToUInt32(length)));
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(deploymentDirName))
|
||||
{
|
||||
var systemPath = Path.Combine(Environment.SystemDirectory, fileName);
|
||||
if (File.Exists(systemPath))
|
||||
{
|
||||
V8SplitProxyNative.InvokeNoThrow(instance => instance.V8Environment_InitializeICU(systemPath));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper restore RedundantJumpStatement
|
||||
}
|
||||
|
||||
private static IEnumerable<string> GetDirPaths(string platform, string architecture)
|
||||
|
@ -203,24 +201,5 @@ namespace Microsoft.ClearScript.V8
|
|||
public abstract void Dispose();
|
||||
|
||||
#endregion
|
||||
|
||||
#region unit test support
|
||||
|
||||
private static string deploymentDirName = string.Empty;
|
||||
|
||||
internal static void RunWithDeploymentDir(string name, Action action)
|
||||
{
|
||||
deploymentDirName = name;
|
||||
try
|
||||
{
|
||||
action();
|
||||
}
|
||||
finally
|
||||
{
|
||||
deploymentDirName = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,21 +179,21 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// A V8 runtime unconditionally terminates the process when it exceeds its resource
|
||||
/// constraints (see <see cref="V8RuntimeConstraints"/>). This property enables external
|
||||
/// constraints (see <c><see cref="V8RuntimeConstraints"/></c>). This property enables external
|
||||
/// heap size monitoring that can prevent termination in some scenarios. To be effective,
|
||||
/// it should be set to a value that is significantly lower than
|
||||
/// <see cref="V8RuntimeConstraints.MaxOldSpaceSize"/>. Note that enabling heap size
|
||||
/// <c><see cref="V8RuntimeConstraints.MaxOldSpaceSize"/></c>. Note that enabling heap size
|
||||
/// monitoring results in slower script execution.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Exceeding this limit causes the V8 runtime to behave in accordance with
|
||||
/// <see cref="HeapSizeViolationPolicy"/>.
|
||||
/// <c><see cref="HeapSizeViolationPolicy"/></c>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Note that
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see>
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see></c>
|
||||
/// memory is allocated outside the runtime's heap and is therefore not tracked by heap
|
||||
/// size monitoring. See <see cref="V8RuntimeConstraints.MaxArrayBufferAllocation"/> for
|
||||
/// size monitoring. See <c><see cref="V8RuntimeConstraints.MaxArrayBufferAllocation"/></c> for
|
||||
/// additional information.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
@ -217,7 +217,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property is effective only when heap size monitoring is enabled (see
|
||||
/// <see cref="MaxHeapSize"/>).
|
||||
/// <c><see cref="MaxHeapSize"/></c>).
|
||||
/// </remarks>
|
||||
public TimeSpan HeapSizeSampleInterval
|
||||
{
|
||||
|
@ -277,8 +277,8 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default, when nested script execution is interrupted via
|
||||
/// <see cref="ScriptEngine.Interrupt"/>, an instance of
|
||||
/// <see cref="ScriptInterruptedException"/>, if not handled by the host, is wrapped and
|
||||
/// <c><see cref="ScriptEngine.Interrupt"/></c>, an instance of
|
||||
/// <c><see cref="ScriptInterruptedException"/></c>, if not handled by the host, is wrapped and
|
||||
/// delivered to the parent script frame as a normal exception that JavaScript code can
|
||||
/// catch. Setting this property to <c>true</c> causes the V8 runtime to remain in the
|
||||
/// interrupted state until its outermost script frame has been processed.
|
||||
|
@ -488,7 +488,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// The generated cache data can be stored externally and is usable in other V8 runtimes
|
||||
/// and application processes.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, V8CacheKind, byte[], out bool)"/>
|
||||
/// <c><seealso cref="Compile(string, V8CacheKind, byte[], out bool)"/></c>
|
||||
public V8Script Compile(string code, V8CacheKind cacheKind, out byte[] cacheBytes)
|
||||
{
|
||||
return Compile(null, code, cacheKind, out cacheBytes);
|
||||
|
@ -506,7 +506,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// The generated cache data can be stored externally and is usable in other V8 runtimes
|
||||
/// and application processes.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, string, V8CacheKind, byte[], out bool)"/>
|
||||
/// <c><seealso cref="Compile(string, string, V8CacheKind, byte[], out bool)"/></c>
|
||||
public V8Script Compile(string documentName, string code, V8CacheKind cacheKind, out byte[] cacheBytes)
|
||||
{
|
||||
return Compile(new DocumentInfo(documentName), code, cacheKind, out cacheBytes);
|
||||
|
@ -524,7 +524,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// The generated cache data can be stored externally and is usable in other V8 runtimes
|
||||
/// and application processes.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(DocumentInfo, string, V8CacheKind, byte[], out bool)"/>
|
||||
/// <c><seealso cref="Compile(DocumentInfo, string, V8CacheKind, byte[], out bool)"/></c>
|
||||
public V8Script Compile(DocumentInfo documentInfo, string code, V8CacheKind cacheKind, out byte[] cacheBytes)
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
@ -543,7 +543,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// To be accepted, the cache data must have been generated for identical script code by
|
||||
/// the same V8 build.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, V8CacheKind, out byte[])"/>
|
||||
/// <c><seealso cref="Compile(string, V8CacheKind, out byte[])"/></c>
|
||||
public V8Script Compile(string code, V8CacheKind cacheKind, byte[] cacheBytes, out bool cacheAccepted)
|
||||
{
|
||||
return Compile(null, code, cacheKind, cacheBytes, out cacheAccepted);
|
||||
|
@ -562,7 +562,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// To be accepted, the cache data must have been generated for identical script code by
|
||||
/// the same V8 build.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, string, V8CacheKind, out byte[])"/>
|
||||
/// <c><seealso cref="Compile(string, string, V8CacheKind, out byte[])"/></c>
|
||||
public V8Script Compile(string documentName, string code, V8CacheKind cacheKind, byte[] cacheBytes, out bool cacheAccepted)
|
||||
{
|
||||
return Compile(new DocumentInfo(documentName), code, cacheKind, cacheBytes, out cacheAccepted);
|
||||
|
@ -581,7 +581,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// To be accepted, the cache data must have been generated for identical script code by
|
||||
/// the same V8 build.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(DocumentInfo, string, V8CacheKind, out byte[])"/>
|
||||
/// <c><seealso cref="Compile(DocumentInfo, string, V8CacheKind, out byte[])"/></c>
|
||||
public V8Script Compile(DocumentInfo documentInfo, string code, V8CacheKind cacheKind, byte[] cacheBytes, out bool cacheAccepted)
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
@ -735,7 +735,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <summary>
|
||||
/// Returns memory usage information.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="V8RuntimeHeapInfo"/> object containing memory usage information.</returns>
|
||||
/// <returns>A <c><see cref="V8RuntimeHeapInfo"/></c> object containing memory usage information.</returns>
|
||||
public V8RuntimeHeapInfo GetHeapInfo()
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Microsoft.ClearScript.V8
|
|||
// ReSharper disable EmptyConstructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="V8RuntimeConstraints"/> instance.
|
||||
/// Initializes a new <c><see cref="V8RuntimeConstraints"/></c> instance.
|
||||
/// </summary>
|
||||
public V8RuntimeConstraints()
|
||||
{
|
||||
|
@ -89,14 +89,14 @@ namespace Microsoft.ClearScript.V8
|
|||
/// whenever the script engine is close to exceeding the current limit. Note that a buggy
|
||||
/// or malicious script can still cause an application to fail by exhausting its address
|
||||
/// space or total available memory. On-demand heap expansion is recommended for use in
|
||||
/// conjunction with heap size monitoring (see <see cref="V8Runtime.MaxHeapSize"/>,
|
||||
/// <see cref="V8ScriptEngine.MaxRuntimeHeapSize"/>) to help contain runaway scripts.
|
||||
/// conjunction with heap size monitoring (see <c><see cref="V8Runtime.MaxHeapSize"/></c>,
|
||||
/// <c><see cref="V8ScriptEngine.MaxRuntimeHeapSize"/></c>) to help contain runaway scripts.
|
||||
/// </remarks>
|
||||
public double HeapExpansionMultiplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum amount of
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see>
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see></c>
|
||||
/// memory the runtime may allocate.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Microsoft.ClearScript.V8
|
|||
|
||||
/// <summary>
|
||||
/// Specifies that remote script debugging is to be enabled. This option is ignored if
|
||||
/// <see cref="EnableDebugging"/> is not specified.
|
||||
/// <c><see cref="EnableDebugging"/></c> is not specified.
|
||||
/// </summary>
|
||||
EnableRemoteDebugging = 0x00000002,
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.ClearScript.V8
|
||||
|
@ -6,8 +6,8 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <summary>
|
||||
/// Defines options for V8 runtime behavior in response to a violation.
|
||||
/// </summary>
|
||||
/// <seealso cref="V8Runtime.MaxHeapSize"/>
|
||||
/// <seealso cref="V8ScriptEngine.MaxRuntimeHeapSize"/>
|
||||
/// <c><seealso cref="V8Runtime.MaxHeapSize"/></c>
|
||||
/// <c><seealso cref="V8ScriptEngine.MaxRuntimeHeapSize"/></c>
|
||||
public enum V8RuntimeViolationPolicy
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -21,7 +21,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <summary>
|
||||
/// Specifies that the runtime is to throw a script exception and disable monitoring until
|
||||
/// the host sets the exceeded limit to a new value. This option is less effective at
|
||||
/// preventing process termination than <see cref="Interrupt"/>, but it is more friendly to
|
||||
/// preventing process termination than <c><see cref="Interrupt"/></c>, but it is more friendly to
|
||||
/// asynchronous JavaScript, which relies on post-error processing for mechanisms such as
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</see>
|
||||
/// rejection.
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Microsoft.ClearScript.V8
|
||||
{
|
||||
public sealed partial class V8ScriptEngine
|
||||
{
|
||||
private const string initScript = "Object.defineProperty(this,'EngineInternal',{value:(b=>{let a=a=>a.bind();function d(){return new this(...arguments)}let e=b.isHostObjectKey;delete b.isHostObjectKey;let c=a=>!!a&& !0===a[e],f=Promise,g=Symbol(),h=b.toJson;return delete b.toJson,Object.freeze({commandHolder:{},getCommandResult:a(a=>null==a?a:'function'!=typeof a.hasOwnProperty?'Module'===a[Symbol.toStringTag]?'[module]':'[external]':!0===a[e]?a:'function'!=typeof a.toString?'['+typeof a+']':a.toString()),invokeConstructor:a((a,b)=>{if('function'!=typeof a)throw new Error('Function expected');return d.apply(a,Array.from(b))}),invokeMethod:a((b,a,c)=>{if('function'!=typeof a)throw new Error('Function expected');return a.apply(b,Array.from(c))}),createPromise:a(function(){return new f(...arguments)}),isPromise:a(a=>a instanceof f),isHostObject:a(c),completePromiseWithResult:a((a,b,c)=>{try{b(a())}catch(d){c(d)}}),completePromise:a((a,b,c)=>{try{a(),b()}catch(d){c(d)}}),throwValue:a(a=>{throw a}),getStackTrace:a(()=>{try{throw new Error('[stack trace]')}catch(a){return a.stack}return''}),toIterator:a(function*(a){try{for(;a.MoveNext();)yield a.Current}finally{a.Dispose()}}),toAsyncIterator:a(async function*(a){try{for(;await a.MoveNextPromise();)yield a.Current}finally{await a.DisposePromise()}}),checkpoint:a(()=>{let a=b[g];if(a)throw a}),toJson:a((b,a)=>h?JSON.parse(h(b,a)):a)})})(this)})";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,134 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
Object.defineProperty(this, 'EngineInternal', { value: (globalObject => {
|
||||
|
||||
const bind = value => value.bind();
|
||||
|
||||
function construct() {
|
||||
return new this(...arguments);
|
||||
}
|
||||
|
||||
const isHostObjectKey = globalObject.isHostObjectKey;
|
||||
delete globalObject.isHostObjectKey;
|
||||
const isHostObject = value => !!value && (value[isHostObjectKey] === true);
|
||||
|
||||
const savedPromise = Promise;
|
||||
const checkpointSymbol = Symbol();
|
||||
|
||||
const toJson = globalObject.toJson;
|
||||
delete globalObject.toJson;
|
||||
|
||||
return Object.freeze({
|
||||
|
||||
commandHolder: {},
|
||||
|
||||
getCommandResult: bind(value => {
|
||||
if ((value === null) || (value === undefined)) {
|
||||
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: bind((constructor, args) => {
|
||||
if (typeof(constructor) !== 'function') {
|
||||
throw new Error('Function expected');
|
||||
}
|
||||
return construct.apply(constructor, Array.from(args));
|
||||
}),
|
||||
|
||||
invokeMethod: bind((target, method, args) => {
|
||||
if (typeof(method) !== 'function') {
|
||||
throw new Error('Function expected');
|
||||
}
|
||||
return method.apply(target, Array.from(args));
|
||||
}),
|
||||
|
||||
createPromise: bind(function () {
|
||||
return new savedPromise(...arguments);
|
||||
}),
|
||||
|
||||
isPromise: bind(value => value instanceof savedPromise),
|
||||
|
||||
isHostObject: bind(isHostObject),
|
||||
|
||||
completePromiseWithResult: bind((getResult, resolve, reject) => {
|
||||
try {
|
||||
resolve(getResult());
|
||||
}
|
||||
catch (exception) {
|
||||
reject(exception);
|
||||
}
|
||||
return undefined;
|
||||
}),
|
||||
|
||||
completePromise: bind((wait, resolve, reject) => {
|
||||
try {
|
||||
wait();
|
||||
resolve();
|
||||
}
|
||||
catch (exception) {
|
||||
reject(exception);
|
||||
}
|
||||
return undefined;
|
||||
}),
|
||||
|
||||
throwValue: bind(value => {
|
||||
throw value;
|
||||
}),
|
||||
|
||||
getStackTrace: bind(() => {
|
||||
try {
|
||||
throw new Error('[stack trace]');
|
||||
}
|
||||
catch (exception) {
|
||||
return exception.stack;
|
||||
}
|
||||
return '';
|
||||
}),
|
||||
|
||||
toIterator: bind(function* (enumerator) {
|
||||
try {
|
||||
while (enumerator.MoveNext()) {
|
||||
yield enumerator.Current;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
enumerator.Dispose();
|
||||
}
|
||||
}),
|
||||
|
||||
toAsyncIterator: bind(async function* (asyncEnumerator) {
|
||||
try {
|
||||
while (await asyncEnumerator.MoveNextPromise()) {
|
||||
yield asyncEnumerator.Current;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
await asyncEnumerator.DisposePromise();
|
||||
}
|
||||
}),
|
||||
|
||||
checkpoint: bind(() => {
|
||||
const value = globalObject[checkpointSymbol];
|
||||
if (value) {
|
||||
throw value;
|
||||
}
|
||||
}),
|
||||
|
||||
toJson: bind((key, value) => toJson ? JSON.parse(toJson(key, value)) : value)
|
||||
|
||||
});
|
||||
})(this) });
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
|
||||
<#@ assembly name="EnvDTE" #>
|
||||
<#@ assembly name="System.Net.Http" #>
|
||||
|
||||
<#@ import namespace="EnvDTE" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="System.Net.Http" #>
|
||||
|
||||
<#
|
||||
var dte = (DTE)((IServiceProvider)Host).GetService(typeof(DTE));
|
||||
var solutionPath = Path.GetDirectoryName(dte.Solution.FullName);
|
||||
var scriptPath = Path.Combine(solutionPath, "ClearScript", "V8", "V8ScriptEngine.InitScript.js");
|
||||
var script = File.ReadAllText(scriptPath);
|
||||
var contentData = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("input", script) };
|
||||
using var client = new HttpClient();
|
||||
using var content = new FormUrlEncodedContent(contentData);
|
||||
using var response = client.PostAsync("https://www.toptal.com/developers/javascript-minifier/api/raw", content).Result;
|
||||
response.EnsureSuccessStatusCode();
|
||||
script = response.Content.ReadAsStringAsync().Result.Replace('\"', '\'');
|
||||
#>
|
||||
|
||||
namespace Microsoft.ClearScript.V8
|
||||
{
|
||||
public sealed partial class V8ScriptEngine
|
||||
{
|
||||
private const string initScript = "<#= script #>";
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.ClearScript.JavaScript;
|
||||
using Microsoft.ClearScript.Util;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.ClearScript.V8
|
||||
{
|
||||
|
@ -231,143 +232,12 @@ namespace Microsoft.ClearScript.V8
|
|||
proxy = V8ContextProxy.Create(runtime.IsolateProxy, Name, flags, debugPort);
|
||||
script = (V8ScriptItem)GetRootItem();
|
||||
|
||||
Execute(initScriptInfo,
|
||||
@"
|
||||
Object.defineProperty(this, 'EngineInternal', { value: (function () {
|
||||
if (flags.HasFlag(V8ScriptEngineFlags.EnableStringifyEnhancements))
|
||||
{
|
||||
script.SetProperty("toJson", new Func<object, object, string>(new JsonHelper(this).ToJson));
|
||||
}
|
||||
|
||||
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;
|
||||
const checkpointSymbol = Symbol();
|
||||
|
||||
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) {
|
||||
try {
|
||||
while (enumerator.MoveNext()) {
|
||||
yield enumerator.Current;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
enumerator.Dispose();
|
||||
}
|
||||
},
|
||||
|
||||
toAsyncIterator: async function* (asyncEnumerator) {
|
||||
try {
|
||||
while (await asyncEnumerator.MoveNextPromise()) {
|
||||
yield asyncEnumerator.Current;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
await asyncEnumerator.DisposePromise();
|
||||
}
|
||||
},
|
||||
|
||||
checkpoint: function () {
|
||||
const value = globalThis[checkpointSymbol];
|
||||
if (value) {
|
||||
throw value;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
})() });
|
||||
"
|
||||
);
|
||||
Execute(initScriptInfo, initScript);
|
||||
|
||||
if (flags.HasFlag(V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart))
|
||||
{
|
||||
|
@ -402,21 +272,21 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// A V8 runtime unconditionally terminates the process when it exceeds its resource
|
||||
/// constraints (see <see cref="V8RuntimeConstraints"/>). This property enables external
|
||||
/// constraints (see <c><see cref="V8RuntimeConstraints"/></c>). This property enables external
|
||||
/// heap size monitoring that can prevent termination in some scenarios. To be effective,
|
||||
/// it should be set to a value that is significantly lower than
|
||||
/// <see cref="V8RuntimeConstraints.MaxOldSpaceSize"/>. Note that enabling heap size
|
||||
/// <c><see cref="V8RuntimeConstraints.MaxOldSpaceSize"/></c>. Note that enabling heap size
|
||||
/// monitoring results in slower script execution.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Exceeding this limit causes the V8 runtime to behave in accordance with
|
||||
/// <see cref="RuntimeHeapSizeViolationPolicy"/>.
|
||||
/// <c><see cref="RuntimeHeapSizeViolationPolicy"/></c>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Note that
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see>
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</see></c>
|
||||
/// memory is allocated outside the runtime's heap and is therefore not tracked by heap
|
||||
/// size monitoring. See <see cref="V8RuntimeConstraints.MaxArrayBufferAllocation"/> for
|
||||
/// size monitoring. See <c><see cref="V8RuntimeConstraints.MaxArrayBufferAllocation"/></c> for
|
||||
/// additional information.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
@ -440,7 +310,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property is effective only when heap size monitoring is enabled (see
|
||||
/// <see cref="MaxRuntimeHeapSize"/>).
|
||||
/// <c><see cref="MaxRuntimeHeapSize"/></c>).
|
||||
/// </remarks>
|
||||
public TimeSpan RuntimeHeapSizeSampleInterval
|
||||
{
|
||||
|
@ -519,7 +389,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// invocable regardless of this property's value.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This property has no effect if <see cref="SuppressInstanceMethodEnumeration"/> is set
|
||||
/// This property has no effect if <c><see cref="SuppressInstanceMethodEnumeration"/></c> is set
|
||||
/// to <c>true</c>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
@ -538,8 +408,8 @@ namespace Microsoft.ClearScript.V8
|
|||
/// Enables or disables interrupt propagation in the V8 runtime.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default, when nested script execution is interrupted via <see cref="Interrupt"/>, an
|
||||
/// instance of <see cref="ScriptInterruptedException"/>, if not handled by the host, is
|
||||
/// By default, when nested script execution is interrupted via <c><see cref="Interrupt"/></c>, an
|
||||
/// instance of <c><see cref="ScriptInterruptedException"/></c>, if not handled by the host, is
|
||||
/// wrapped and delivered to the parent script frame as a normal exception that JavaScript
|
||||
/// code can catch. Setting this property to <c>true</c> causes the V8 runtime to remain in
|
||||
/// the interrupted state until its outermost script frame has been processed.
|
||||
|
@ -633,7 +503,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// The generated cache data can be stored externally and is usable in other V8 script
|
||||
/// engines and application processes.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, V8CacheKind, byte[], out bool)"/>
|
||||
/// <c><seealso cref="Compile(string, V8CacheKind, byte[], out bool)"/></c>
|
||||
public V8Script Compile(string code, V8CacheKind cacheKind, out byte[] cacheBytes)
|
||||
{
|
||||
return Compile(null, code, cacheKind, out cacheBytes);
|
||||
|
@ -651,7 +521,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// The generated cache data can be stored externally and is usable in other V8 script
|
||||
/// engines and application processes.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, string, V8CacheKind, byte[], out bool)"/>
|
||||
/// <c><seealso cref="Compile(string, string, V8CacheKind, byte[], out bool)"/></c>
|
||||
public V8Script Compile(string documentName, string code, V8CacheKind cacheKind, out byte[] cacheBytes)
|
||||
{
|
||||
return Compile(new DocumentInfo(documentName), code, cacheKind, out cacheBytes);
|
||||
|
@ -669,7 +539,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// The generated cache data can be stored externally and is usable in other V8 script
|
||||
/// engines and application processes.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(DocumentInfo, string, V8CacheKind, byte[], out bool)"/>
|
||||
/// <c><seealso cref="Compile(DocumentInfo, string, V8CacheKind, byte[], out bool)"/></c>
|
||||
public V8Script Compile(DocumentInfo documentInfo, string code, V8CacheKind cacheKind, out byte[] cacheBytes)
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
@ -696,7 +566,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// To be accepted, the cache data must have been generated for identical script code by
|
||||
/// the same V8 build.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, V8CacheKind, out byte[])"/>
|
||||
/// <c><seealso cref="Compile(string, V8CacheKind, out byte[])"/></c>
|
||||
public V8Script Compile(string code, V8CacheKind cacheKind, byte[] cacheBytes, out bool cacheAccepted)
|
||||
{
|
||||
return Compile(null, code, cacheKind, cacheBytes, out cacheAccepted);
|
||||
|
@ -715,7 +585,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// To be accepted, the cache data must have been generated for identical script code by
|
||||
/// the same V8 build.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(string, string, V8CacheKind, out byte[])"/>
|
||||
/// <c><seealso cref="Compile(string, string, V8CacheKind, out byte[])"/></c>
|
||||
public V8Script Compile(string documentName, string code, V8CacheKind cacheKind, byte[] cacheBytes, out bool cacheAccepted)
|
||||
{
|
||||
return Compile(new DocumentInfo(documentName), code, cacheKind, cacheBytes, out cacheAccepted);
|
||||
|
@ -734,7 +604,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// To be accepted, the cache data must have been generated for identical script code by
|
||||
/// the same V8 build.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Compile(DocumentInfo, string, V8CacheKind, out byte[])"/>
|
||||
/// <c><seealso cref="Compile(DocumentInfo, string, V8CacheKind, out byte[])"/></c>
|
||||
public V8Script Compile(DocumentInfo documentInfo, string code, V8CacheKind cacheKind, byte[] cacheBytes, out bool cacheAccepted)
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
@ -902,7 +772,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <returns>The result value.</returns>
|
||||
/// <remarks>
|
||||
/// For information about the types of result values that script code can return, see
|
||||
/// <see cref="ScriptEngine.Evaluate(string, bool, string)"/>.
|
||||
/// <c><see cref="ScriptEngine.Evaluate(string, bool, string)"/></c>.
|
||||
/// </remarks>
|
||||
public object Evaluate(V8Script script)
|
||||
{
|
||||
|
@ -914,7 +784,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </summary>
|
||||
/// <param name="script">The compiled script to execute.</param>
|
||||
/// <remarks>
|
||||
/// This method is similar to <see cref="Evaluate(V8Script)"/> with the exception that it
|
||||
/// This method is similar to <c><see cref="Evaluate(V8Script)"/></c> with the exception that it
|
||||
/// does not marshal a result value to the host. It can provide a performance advantage
|
||||
/// when the result value is not needed.
|
||||
/// </remarks>
|
||||
|
@ -931,7 +801,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <remarks>
|
||||
/// This method can be called safely from any thread.
|
||||
/// </remarks>
|
||||
/// <seealso cref="Interrupt"/>
|
||||
/// <c><seealso cref="Interrupt"/></c>
|
||||
public void CancelInterrupt()
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
@ -941,7 +811,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <summary>
|
||||
/// Returns memory usage information for the V8 runtime.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="V8RuntimeHeapInfo"/> object containing memory usage information for the V8 runtime.</returns>
|
||||
/// <returns>A <c><see cref="V8RuntimeHeapInfo"/></c> object containing memory usage information for the V8 runtime.</returns>
|
||||
public V8RuntimeHeapInfo GetRuntimeHeapInfo()
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
@ -1275,7 +1145,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// Gets the script engine's recommended file name extension for script files.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="V8ScriptEngine"/> instances return "js" for this property.
|
||||
/// <c><see cref="V8ScriptEngine"/></c> instances return "js" for this property.
|
||||
/// </remarks>
|
||||
public override string FileNameExtension => "js";
|
||||
|
||||
|
@ -1302,8 +1172,8 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <remarks>
|
||||
/// The value of this property is an object that is bound to the script engine's root
|
||||
/// namespace. It allows you to access global script resources via the
|
||||
/// <see cref="ScriptObject"/> class interface. Doing so is likely to perform better than
|
||||
/// dynamic access via <see cref="Script"/>.
|
||||
/// <c><see cref="ScriptObject"/></c> class interface. Doing so is likely to perform better than
|
||||
/// dynamic access via <c><see cref="Script"/></c>.
|
||||
/// </remarks>
|
||||
public override ScriptObject Global
|
||||
{
|
||||
|
@ -1321,14 +1191,14 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <returns>The command output.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This method is similar to <see cref="ScriptEngine.Evaluate(string)"/> but optimized for
|
||||
/// This method is similar to <c><see cref="ScriptEngine.Evaluate(string)"/></c> but optimized for
|
||||
/// command consoles. The specified command must be limited to a single expression or
|
||||
/// statement. Script engines can override this method to customize command execution as
|
||||
/// well as the process of converting the result to a string for console output.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <see cref="V8ScriptEngine"/> version of this method attempts to use
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/tostring">toString</see>
|
||||
/// The <c><see cref="V8ScriptEngine"/></c> version of this method attempts to use
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/tostring">toString</see></c>
|
||||
/// to convert the return value.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
@ -1362,7 +1232,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// <remarks>
|
||||
/// This method can be called safely from any thread.
|
||||
/// </remarks>
|
||||
/// <seealso cref="CancelInterrupt"/>
|
||||
/// <c><seealso cref="CancelInterrupt"/></c>
|
||||
public override void Interrupt()
|
||||
{
|
||||
VerifyNotDisposed();
|
||||
|
@ -1666,11 +1536,11 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </summary>
|
||||
/// <param name="disposing"><c>True</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
/// <remarks>
|
||||
/// This method is called by the public <see cref="ScriptEngine.Dispose()"/> method and the
|
||||
/// <see cref="ScriptEngine.Finalize">Finalize</see> method.
|
||||
/// <see cref="ScriptEngine.Dispose()"/> invokes the protected <c>Dispose(Boolean)</c>
|
||||
/// This method is called by the public <c><see cref="ScriptEngine.Dispose()"/></c> method and the
|
||||
/// <c><see cref="ScriptEngine.Finalize">Finalize</see></c> method.
|
||||
/// <c><see cref="ScriptEngine.Dispose()"/></c> invokes the protected <c>Dispose(Boolean)</c>
|
||||
/// method with the <paramref name="disposing"/> parameter set to <c>true</c>.
|
||||
/// <see cref="ScriptEngine.Finalize">Finalize</see> invokes <c>Dispose(Boolean)</c> with
|
||||
/// <c><see cref="ScriptEngine.Finalize">Finalize</see></c> invokes <c>Dispose(Boolean)</c> with
|
||||
/// <paramref name="disposing"/> set to <c>false</c>.
|
||||
/// </remarks>
|
||||
protected override void Dispose(bool disposing)
|
||||
|
@ -1792,5 +1662,56 @@ namespace Microsoft.ClearScript.V8
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: JsonHelper
|
||||
|
||||
/// <exclude/>
|
||||
public sealed class JsonHelper : JsonConverter
|
||||
{
|
||||
private readonly ScriptObject stringify;
|
||||
private readonly HashSet<object> cycleDetectionSet = new HashSet<object>();
|
||||
|
||||
/// <exclude/>
|
||||
public JsonHelper(ScriptEngine engine)
|
||||
{
|
||||
stringify = engine.Script.JSON.stringify;
|
||||
}
|
||||
|
||||
/// <exclude/>
|
||||
public string ToJson(object key, object value)
|
||||
{
|
||||
key = MiscHelpers.EnsureNonBlank(key.ToString(), "[root]");
|
||||
|
||||
if (cycleDetectionSet.Contains(value))
|
||||
{
|
||||
throw new InvalidOperationException($"Cycle detected at key '{key}' during JSON serialization");
|
||||
}
|
||||
|
||||
cycleDetectionSet.Add(value);
|
||||
try
|
||||
{
|
||||
return JsonConvert.SerializeObject(value, this);
|
||||
}
|
||||
finally
|
||||
{
|
||||
cycleDetectionSet.Remove(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <exclude/>
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
var result = stringify.Invoke(false, value);
|
||||
writer.WriteRawValue(result as string ?? "null");
|
||||
}
|
||||
|
||||
/// <exclude/>
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) => throw new NotImplementedException();
|
||||
|
||||
/// <exclude/>
|
||||
public override bool CanConvert(Type objectType) => typeof(V8ScriptItem).IsAssignableFrom(objectType);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,32 +23,32 @@ namespace Microsoft.ClearScript.V8
|
|||
EnableDebugging = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that support for <see cref="HostItemFlags.GlobalMembers"/> behavior is to be
|
||||
/// Specifies that support for <c><see cref="HostItemFlags.GlobalMembers"/></c> behavior is to be
|
||||
/// disabled. This option yields a significant performance benefit for global item access.
|
||||
/// </summary>
|
||||
DisableGlobalMembers = 0x00000002,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that remote script debugging is to be enabled. This option is ignored if
|
||||
/// <see cref="EnableDebugging"/> is not specified.
|
||||
/// <c><see cref="EnableDebugging"/></c> is not specified.
|
||||
/// </summary>
|
||||
EnableRemoteDebugging = 0x00000004,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the script engine is to wait for a debugger connection and schedule a
|
||||
/// pause before executing the first line of application script code. This option is
|
||||
/// ignored if <see cref="EnableDebugging"/> is not specified.
|
||||
/// ignored if <c><see cref="EnableDebugging"/></c> is not specified.
|
||||
/// </summary>
|
||||
AwaitDebuggerAndPauseOnStart = 0x00000008,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the script engine is to perform automatic conversion between
|
||||
/// .NET <see cref="DateTime"/> objects and JavaScript
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see>
|
||||
/// .NET <c><see cref="DateTime"/></c> objects and JavaScript
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</see></c>
|
||||
/// objects. This conversion is bidirectional and lossy. A <c>DateTime</c> object
|
||||
/// constructed from a JavaScript <c>Date</c> object always represents a Coordinated
|
||||
/// Universal Timestamp (UTC) and has its <see cref="DateTime.Kind"/> property set to
|
||||
/// <see cref="DateTimeKind.Utc"/>.
|
||||
/// Universal Timestamp (UTC) and has its <c><see cref="DateTime.Kind"/></c> property set to
|
||||
/// <c><see cref="DateTimeKind.Utc"/></c>.
|
||||
/// </summary>
|
||||
EnableDateTimeConversion = 0x00000010,
|
||||
|
||||
|
@ -61,27 +61,27 @@ namespace Microsoft.ClearScript.V8
|
|||
|
||||
/// <summary>
|
||||
/// Specifies that long integers with values greater than
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER">Number.MAX_SAFE_INTEGER</see>
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER">Number.MAX_SAFE_INTEGER</see></c>
|
||||
/// or less than
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER">Number.MIN_SAFE_INTEGER</see>
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER">Number.MIN_SAFE_INTEGER</see></c>
|
||||
/// are to be marshaled as
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see>.
|
||||
/// This option is ignored if <see cref="MarshalAllLongAsBigInt"/> is specified.
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see></c>.
|
||||
/// This option is ignored if <c><see cref="MarshalAllLongAsBigInt"/></c> is specified.
|
||||
/// </summary>
|
||||
MarshalUnsafeLongAsBigInt = 0x00000040,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that all long integers are to be marshaled as
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see>.
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt">BigInt</see></c>.
|
||||
/// </summary>
|
||||
MarshalAllLongAsBigInt = 0x00000080,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the script engine is to perform automatic conversion between
|
||||
/// .NET <see cref="Task"/> objects and JavaScript
|
||||
/// .NET <c><see cref="Task"/></c> objects and JavaScript
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promises</see>.
|
||||
/// This conversion is bidirectional and lossy. A <c>Task</c> object constructed from a
|
||||
/// JavaScript promise always has a result type of <see cref="object"/>.
|
||||
/// JavaScript promise always has a result type of <c><see cref="object"/></c>.
|
||||
/// </summary>
|
||||
EnableTaskPromiseConversion = 0x00000100,
|
||||
|
||||
|
@ -92,7 +92,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// .NET <c>ValueTask</c> and <c>ValueTask<TResult></c> structures to JavaScript
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promises</see>.
|
||||
/// This conversion is unidirectional and lossy. This option is ignored if
|
||||
/// <see cref="EnableTaskPromiseConversion"/> is not specified.
|
||||
/// <c><see cref="EnableTaskPromiseConversion"/></c> is not specified.
|
||||
/// </summary>
|
||||
EnableValueTaskPromiseConversion = 0x00000200,
|
||||
|
||||
|
@ -100,10 +100,10 @@ namespace Microsoft.ClearScript.V8
|
|||
|
||||
/// <summary>
|
||||
/// Specifies that the script engine is to perform automatic conversion from
|
||||
/// .NET <see cref="ValueTask"/> and <see cref="ValueTask{T}"/> structures to JavaScript
|
||||
/// .NET <c><see cref="ValueTask"/></c> and <c><see cref="ValueTask{T}"/></c> structures to JavaScript
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promises</see>.
|
||||
/// This conversion is unidirectional and lossy. This option is ignored if
|
||||
/// <see cref="EnableTaskPromiseConversion"/> is not specified.
|
||||
/// <c><see cref="EnableTaskPromiseConversion"/></c> is not specified.
|
||||
/// </summary>
|
||||
EnableValueTaskPromiseConversion = 0x00000200,
|
||||
|
||||
|
@ -114,6 +114,24 @@ namespace Microsoft.ClearScript.V8
|
|||
/// option can introduce ambiguity if the host resource has distinct members whose names
|
||||
/// differ only in case, so it should be used with caution.
|
||||
/// </summary>
|
||||
UseCaseInsensitiveMemberBinding = 0x00000400
|
||||
UseCaseInsensitiveMemberBinding = 0x00000400,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify">JSON.stringify</see></c>
|
||||
/// enhancements are to be enabled. These enhancements add support for host objects via the
|
||||
/// <see href="https://www.newtonsoft.com/json">Json.NET</see> library.
|
||||
/// </summary>
|
||||
EnableStringifyEnhancements = 0x00000800,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that host exceptions are to be hidden from script code. If an exception
|
||||
/// thrown by the host reaches the script engine, it is caught automatically, and an
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</see></c>
|
||||
/// object is thrown in its place. By default, ClearScript makes the managed exception
|
||||
/// accessible to script code via the <c>Error</c> object's <c>hostException</c> property.
|
||||
/// This option suppresses that behavior.
|
||||
/// </summary>
|
||||
HideHostExceptions = 0x00001000
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -25,7 +25,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </para>
|
||||
/// <para>
|
||||
/// To enable Top-Level Await, set this property to <c>true</c> before instantiating
|
||||
/// <see cref="V8ScriptEngine"/> or <see cref="V8Runtime"/> for the first time. Subsequent
|
||||
/// <c><see cref="V8ScriptEngine"/></c> or <c><see cref="V8Runtime"/></c> for the first time. Subsequent
|
||||
/// reassignment will have no effect.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
@ -37,7 +37,7 @@ namespace Microsoft.ClearScript.V8
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// To override the default global options, set this property before instantiating
|
||||
/// <see cref="V8ScriptEngine"/> or <see cref="V8Runtime"/> for the first time. Subsequent
|
||||
/// <c><see cref="V8ScriptEngine"/></c> or <c><see cref="V8Runtime"/></c> for the first time. Subsequent
|
||||
/// reassignment will have no effect.
|
||||
/// </remarks>
|
||||
public static V8GlobalFlags GlobalFlags { get; set; }
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace Microsoft.ClearScript
|
|||
/// Some script languages expect every subroutine call to return a value. When script code
|
||||
/// written in such a language invokes a host method that explicitly returns no value (such
|
||||
/// as a C#
|
||||
/// <see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/void">void</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/void">void</see></c>
|
||||
/// method), the ClearScript library provides an instance of this class as a dummy return
|
||||
/// value.
|
||||
/// </remarks>
|
||||
/// <seealso cref="ScriptEngine.VoidResultValue"/>
|
||||
/// <c><seealso cref="ScriptEngine.VoidResultValue"/></c>
|
||||
public class VoidResult
|
||||
{
|
||||
/// <summary>
|
||||
/// The sole instance of the <see cref="VoidResult"/> class.
|
||||
/// The sole instance of the <c><see cref="VoidResult"/></c> class.
|
||||
/// </summary>
|
||||
public static readonly VoidResult Value = new VoidResult();
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace Microsoft.ClearScript
|
|||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
/// <remarks>
|
||||
/// The <see cref="VoidResult"/> version of this method returns "[void]".
|
||||
/// The <c><see cref="VoidResult"/></c> version of this method returns "[void]".
|
||||
/// </remarks>
|
||||
public override string ToString()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Microsoft.ClearScript.Windows.Core
|
||||
{
|
||||
public partial class JScriptEngine
|
||||
{
|
||||
internal const string InitScript = "EngineInternal=function(){var a=this;function b(b){var c=[];if(b.GetValue)for(var d=b.Length,a=0;a<d;a++)c.push(b[a]);else for(var d=(b=new VBArray(b)).ubound(1)+1,a=0;a<d;a++)c.push(b.getItem(a));return c}function c(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){return new this(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)}return{getCommandResult:function(a){return null!==a&&('object'==typeof a||'function'==typeof a)&&'function'==typeof a.toString?a.toString():a},invokeConstructor:function(a,d){if('function'!=typeof a)throw new Error('Function expected');return c.apply(a,b(d))},invokeMethod:function(c,a,d){if('function'!=typeof a)throw new Error('Function expected');return a.apply(c,b(d))},isPromise:function(a){return!1},isHostObject:function(b){return!!b&&'function'!=typeof b.constructor&&b!==a},throwValue:function(a){throw a}}}()";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
EngineInternal = (function () {
|
||||
|
||||
var globalObject = this;
|
||||
|
||||
function convertArgs(args) {
|
||||
var result = [];
|
||||
if (args.GetValue) {
|
||||
var count = args.Length;
|
||||
for (var i = 0; i < count; i++) {
|
||||
result.push(args[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
args = new VBArray(args);
|
||||
var count = args.ubound(1) + 1;
|
||||
for (var i = 0; i < count; i++) {
|
||||
result.push(args.getItem(i));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function construct(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) {
|
||||
return new this(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
getCommandResult: function (value) {
|
||||
if (value !== null) {
|
||||
if ((typeof(value) === 'object') || (typeof(value) === 'function')) {
|
||||
if (typeof(value.toString) === 'function') {
|
||||
return value.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},
|
||||
|
||||
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));
|
||||
},
|
||||
|
||||
isPromise: function (value) {
|
||||
return false;
|
||||
},
|
||||
|
||||
isHostObject: function (value) {
|
||||
return !!value && (typeof(value.constructor) !== 'function') && (value !== globalObject);
|
||||
},
|
||||
|
||||
throwValue: function (value) {
|
||||
throw value;
|
||||
}
|
||||
};
|
||||
})();
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
|
||||
<#@ assembly name="EnvDTE" #>
|
||||
<#@ assembly name="System.Net.Http" #>
|
||||
|
||||
<#@ import namespace="EnvDTE" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="System.Net.Http" #>
|
||||
|
||||
<#
|
||||
var dte = (DTE)((IServiceProvider)Host).GetService(typeof(DTE));
|
||||
var solutionPath = Path.GetDirectoryName(dte.Solution.FullName);
|
||||
var scriptPath = Path.Combine(solutionPath, "ClearScript", "Windows", "Core", "JScriptEngine.InitScript.js");
|
||||
var script = File.ReadAllText(scriptPath);
|
||||
var contentData = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("input", script) };
|
||||
using var client = new HttpClient();
|
||||
using var content = new FormUrlEncodedContent(contentData);
|
||||
using var response = client.PostAsync("https://www.toptal.com/developers/javascript-minifier/api/raw", content).Result;
|
||||
response.EnsureSuccessStatusCode();
|
||||
script = response.Content.ReadAsStringAsync().Result.Replace('\"', '\'');
|
||||
#>
|
||||
|
||||
namespace Microsoft.ClearScript.Windows.Core
|
||||
{
|
||||
public partial class JScriptEngine
|
||||
{
|
||||
internal const string InitScript = "<#= script #>";
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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.
|
||||
/// implementation of <c><see cref="ISyncInvoker"/></c> is required to enforce thread affinity.
|
||||
/// </remarks>
|
||||
public partial class JScriptEngine : WindowsScriptEngine, IJavaScriptEngine, IJScriptEngine
|
||||
{
|
||||
|
@ -96,70 +96,6 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
{ 1015, "Unterminated string constant" }
|
||||
};
|
||||
|
||||
internal const string InitScript = @"
|
||||
EngineInternal = (function () {
|
||||
|
||||
function convertArgs(args) {
|
||||
var result = [];
|
||||
if (args.GetValue) {
|
||||
var count = args.Length;
|
||||
for (var i = 0; i < count; i++) {
|
||||
result.push(args[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
args = new VBArray(args);
|
||||
var count = args.ubound(1) + 1;
|
||||
for (var i = 0; i < count; i++) {
|
||||
result.push(args.getItem(i));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function construct(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) {
|
||||
return new this(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
getCommandResult: function (value) {
|
||||
if (value != null) {
|
||||
if ((typeof(value) == 'object') || (typeof(value) == 'function')) {
|
||||
if (typeof(value.toString) == 'function') {
|
||||
return value.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},
|
||||
|
||||
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));
|
||||
},
|
||||
|
||||
isPromise: function (value) {
|
||||
return false;
|
||||
},
|
||||
|
||||
throwValue: function (value) {
|
||||
throw value;
|
||||
}
|
||||
};
|
||||
})();
|
||||
";
|
||||
|
||||
|
||||
private CommonJSManager commonJSManager;
|
||||
|
||||
#endregion
|
||||
|
@ -242,7 +178,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// Gets the script engine's recommended file name extension for script files.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="JScriptEngine"/> instances return "js" for this property.
|
||||
/// <c><see cref="JScriptEngine"/></c> instances return "js" for this property.
|
||||
/// </remarks>
|
||||
public override string FileNameExtension => "js";
|
||||
|
||||
|
@ -253,14 +189,14 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// <returns>The command output.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This method is similar to <see cref="ScriptEngine.Evaluate(string)"/> but optimized for
|
||||
/// This method is similar to <c><see cref="ScriptEngine.Evaluate(string)"/></c> but optimized for
|
||||
/// command consoles. The specified command must be limited to a single expression or
|
||||
/// statement. Script engines can override this method to customize command execution as
|
||||
/// well as the process of converting the result to a string for console output.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <see cref="JScriptEngine"/> version of this method attempts to use
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/tostring">toString</see>
|
||||
/// The <c><see cref="JScriptEngine"/></c> version of this method attempts to use
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/tostring">toString</see></c>
|
||||
/// to convert the return value.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
|
|
@ -6,7 +6,7 @@ using System;
|
|||
namespace Microsoft.ClearScript.Windows.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a null <see cref="ISyncInvoker"/> implementation.
|
||||
/// Provides a null <c><see cref="ISyncInvoker"/></c> implementation.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class does not enforce thread affinity and should be used with caution. Windows Script
|
||||
|
@ -15,7 +15,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
public class NullSyncInvoker : ISyncInvoker
|
||||
{
|
||||
/// <summary>
|
||||
/// The sole instance of the <see cref="NullSyncInvoker"/> class.
|
||||
/// The sole instance of the <c><see cref="NullSyncInvoker"/></c> class.
|
||||
/// </summary>
|
||||
public static readonly ISyncInvoker Instance = new NullSyncInvoker();
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// </summary>
|
||||
/// <returns><c>True</c> if the calling thread has access to the script engine, <c>false</c> otherwise.</returns>
|
||||
/// <remarks>
|
||||
/// The <see cref="NullSyncInvoker"/> implementation of this method always returns <c>true</c>.
|
||||
/// The <c><see cref="NullSyncInvoker"/></c> implementation of this method always returns <c>true</c>.
|
||||
/// </remarks>
|
||||
public bool CheckAccess()
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// Enforces that the calling thread has access to the script engine.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The <see cref="NullSyncInvoker"/> implementation of this method performs no action.
|
||||
/// The <c><see cref="NullSyncInvoker"/></c> implementation of this method performs no action.
|
||||
/// </remarks>
|
||||
public void VerifyAccess()
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// </summary>
|
||||
/// <param name="action">The delegate to invoke on the script engine's thread.</param>
|
||||
/// <remarks>
|
||||
/// The <see cref="NullSyncInvoker"/> implementation of this method invokes
|
||||
/// The <c><see cref="NullSyncInvoker"/></c> implementation of this method invokes
|
||||
/// <paramref name="action"></paramref> without synchronization.
|
||||
/// </remarks>
|
||||
public void Invoke(Action action)
|
||||
|
@ -67,7 +67,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// <param name="func">The delegate to invoke on the script engine's thread.</param>
|
||||
/// <returns>The delegate's return value.</returns>
|
||||
/// <remarks>
|
||||
/// The <see cref="NullSyncInvoker"/> implementation of this method invokes
|
||||
/// The <c><see cref="NullSyncInvoker"/></c> implementation of this method invokes
|
||||
/// <paramref name="func"></paramref> without synchronization.
|
||||
/// </remarks>
|
||||
public T Invoke<T>(Func<T> func)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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.
|
||||
/// implementation of <c><see cref="ISyncInvoker"/></c> is required to enforce thread affinity.
|
||||
/// </remarks>
|
||||
public class VBScriptEngine : WindowsScriptEngine, IVBScriptEngineTag
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
else
|
||||
dim valueTypeName
|
||||
valueTypeName = TypeName(value)
|
||||
if (valueTypeName = ""Object"" or valueTypeName = ""Unknown"") then
|
||||
if valueTypeName = ""Object"" or valueTypeName = ""Unknown"" then
|
||||
set getCommandResult = value
|
||||
else
|
||||
getCommandResult = ""[ScriptObject:"" & valueTypeName & ""]""
|
||||
|
@ -243,6 +243,9 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
public function isPromise(value)
|
||||
isPromise = false
|
||||
end function
|
||||
public function isHostObject(value)
|
||||
isHostObject = IsObject(value) and TypeName(value) = ""Object"" and VarType(value) = 9
|
||||
end function
|
||||
public function throwValue(value)
|
||||
Err.Raise 445
|
||||
end function
|
||||
|
@ -322,7 +325,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// Gets the script engine's recommended file name extension for script files.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="VBScriptEngine"/> instances return "vbs" for this property.
|
||||
/// <c><see cref="VBScriptEngine"/></c> instances return "vbs" for this property.
|
||||
/// </remarks>
|
||||
public override string FileNameExtension => "vbs";
|
||||
|
||||
|
@ -333,16 +336,16 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// <returns>The command output.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This method is similar to <see cref="ScriptEngine.Evaluate(string)"/> but optimized for
|
||||
/// This method is similar to <c><see cref="ScriptEngine.Evaluate(string)"/></c> but optimized for
|
||||
/// command consoles. The specified command must be limited to a single expression or
|
||||
/// statement. Script engines can override this method to customize command execution as
|
||||
/// well as the process of converting the result to a string for console output.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <see cref="VBScriptEngine"/> version of this method supports both expressions and
|
||||
/// The <c><see cref="VBScriptEngine"/></c> version of this method supports both expressions and
|
||||
/// statements. If the specified command begins with "eval " (not case-sensitive), the
|
||||
/// engine executes the remainder as an expression and attempts to use
|
||||
/// <see href="https://docs.microsoft.com/en-us/previous-versions//0zk841e9(v=vs.85)">CStr</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions//0zk841e9(v=vs.85)">CStr</see></c>
|
||||
/// to convert the result value. Otherwise, it executes the command as a statement and does
|
||||
/// not return a value.
|
||||
/// </para>
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 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.
|
||||
/// implementation of <c><see cref="ISyncInvoker"/></c> is required to enforce thread affinity.
|
||||
/// </remarks>
|
||||
public abstract partial class WindowsScriptEngine : ScriptEngine
|
||||
{
|
||||
|
@ -99,7 +99,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
#region public members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="ISyncInvoker"/> implementation associated with the current script engine.
|
||||
/// Gets the <c><see cref="ISyncInvoker"/></c> implementation associated with the current script engine.
|
||||
/// </summary>
|
||||
public ISyncInvoker SyncInvoker
|
||||
{
|
||||
|
@ -525,8 +525,8 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// <remarks>
|
||||
/// The value of this property is an object that is bound to the script engine's root
|
||||
/// namespace. It allows you to access global script resources via the
|
||||
/// <see cref="ScriptObject"/> class interface. Doing so is likely to perform better than
|
||||
/// dynamic access via <see cref="Script"/>.
|
||||
/// <c><see cref="ScriptObject"/></c> class interface. Doing so is likely to perform better than
|
||||
/// dynamic access via <c><see cref="Script"/></c>.
|
||||
/// </remarks>
|
||||
public override ScriptObject Global
|
||||
{
|
||||
|
@ -547,7 +547,7 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// The stack trace text format is defined by the script engine.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <see cref="WindowsScriptEngine"/> version of this method returns the empty string
|
||||
/// The <c><see cref="WindowsScriptEngine"/></c> version of this method returns the empty string
|
||||
/// if script debugging features have not been enabled for the instance.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
@ -776,11 +776,11 @@ namespace Microsoft.ClearScript.Windows.Core
|
|||
/// </summary>
|
||||
/// <param name="disposing"><c>True</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
/// <remarks>
|
||||
/// This method is called by the public <see cref="ScriptEngine.Dispose()"/> method and the
|
||||
/// <see cref="ScriptEngine.Finalize">Finalize</see> method.
|
||||
/// <see cref="ScriptEngine.Dispose()"/> invokes the protected <c>Dispose(Boolean)</c>
|
||||
/// This method is called by the public <c><see cref="ScriptEngine.Dispose()"/></c> method and the
|
||||
/// <c><see cref="ScriptEngine.Finalize">Finalize</see></c> method.
|
||||
/// <c><see cref="ScriptEngine.Dispose()"/></c> invokes the protected <c>Dispose(Boolean)</c>
|
||||
/// method with the <paramref name="disposing"/> parameter set to <c>true</c>.
|
||||
/// <see cref="ScriptEngine.Finalize">Finalize</see> invokes <c>Dispose(Boolean)</c> with
|
||||
/// <c><see cref="ScriptEngine.Finalize">Finalize</see></c> invokes <c>Dispose(Boolean)</c> with
|
||||
/// <paramref name="disposing"/> set to <c>false</c>.
|
||||
/// </remarks>
|
||||
protected override void Dispose(bool disposing)
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// <summary>
|
||||
/// Allows Windows Script engines to display dialogs within the host's user interface.
|
||||
/// </summary>
|
||||
/// <seealso cref="Core.WindowsScriptEngine.HostWindow"/>
|
||||
/// <c><seealso cref="Core.WindowsScriptEngine.HostWindow"/></c>
|
||||
public interface IHostWindow
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Each Windows Script engine instance in a desktop environment has thread affinity and is
|
||||
/// bound to a <see cref="System.Windows.Threading.Dispatcher"/> during instantiation.
|
||||
/// bound to a <c><see cref="System.Windows.Threading.Dispatcher"/></c> during instantiation.
|
||||
/// 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>
|
||||
|
@ -98,7 +98,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// Gets the script engine's recommended file name extension for script files.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="JScriptEngine"/> instances return "js" for this property.
|
||||
/// <c><see cref="JScriptEngine"/></c> instances return "js" for this property.
|
||||
/// </remarks>
|
||||
public override string FileNameExtension => "js";
|
||||
|
||||
|
@ -109,14 +109,14 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// <returns>The command output.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This method is similar to <see cref="ScriptEngine.Evaluate(string)"/> but optimized for
|
||||
/// This method is similar to <c><see cref="ScriptEngine.Evaluate(string)"/></c> but optimized for
|
||||
/// command consoles. The specified command must be limited to a single expression or
|
||||
/// statement. Script engines can override this method to customize command execution as
|
||||
/// well as the process of converting the result to a string for console output.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <see cref="JScriptEngine"/> version of this method attempts to use
|
||||
/// <see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/tostring">toString</see>
|
||||
/// The <c><see cref="JScriptEngine"/></c> version of this method attempts to use
|
||||
/// <c><see href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/tostring">toString</see></c>
|
||||
/// to convert the return value.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
public class Nothing : INothingTag
|
||||
{
|
||||
/// <summary>
|
||||
/// The sole instance of the <see cref="Nothing"/> class.
|
||||
/// The sole instance of the <c><see cref="Nothing"/></c> class.
|
||||
/// </summary>
|
||||
public static readonly Nothing Value = new Nothing();
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
/// <remarks>
|
||||
/// The <see cref="Nothing"/> version of this method returns "[nothing]".
|
||||
/// The <c><see cref="Nothing"/></c> version of this method returns "[nothing]".
|
||||
/// </remarks>
|
||||
public override string ToString()
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Each Windows Script engine instance in a desktop environment has thread affinity and is
|
||||
/// bound to a <see cref="System.Windows.Threading.Dispatcher"/> during instantiation.
|
||||
/// bound to a <c><see cref="System.Windows.Threading.Dispatcher"/></c> during instantiation.
|
||||
/// 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>
|
||||
|
@ -82,7 +82,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// Gets the script engine's recommended file name extension for script files.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="VBScriptEngine"/> instances return "vbs" for this property.
|
||||
/// <c><see cref="VBScriptEngine"/></c> instances return "vbs" for this property.
|
||||
/// </remarks>
|
||||
public override string FileNameExtension => "vbs";
|
||||
|
||||
|
@ -93,16 +93,16 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// <returns>The command output.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This method is similar to <see cref="ScriptEngine.Evaluate(string)"/> but optimized for
|
||||
/// This method is similar to <c><see cref="ScriptEngine.Evaluate(string)"/></c> but optimized for
|
||||
/// command consoles. The specified command must be limited to a single expression or
|
||||
/// statement. Script engines can override this method to customize command execution as
|
||||
/// well as the process of converting the result to a string for console output.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <see cref="VBScriptEngine"/> version of this method supports both expressions and
|
||||
/// The <c><see cref="VBScriptEngine"/></c> version of this method supports both expressions and
|
||||
/// statements. If the specified command begins with "eval " (not case-sensitive), the
|
||||
/// engine executes the remainder as an expression and attempts to use
|
||||
/// <see href="https://docs.microsoft.com/en-us/previous-versions//0zk841e9(v=vs.85)">CStr</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions//0zk841e9(v=vs.85)">CStr</see></c>
|
||||
/// to convert the result value. Otherwise, it executes the command as a statement and does
|
||||
/// not return a value.
|
||||
/// </para>
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Each Windows Script engine instance in a desktop environment has thread affinity and is
|
||||
/// bound to a <see cref="System.Windows.Threading.Dispatcher"/> during instantiation.
|
||||
/// bound to a <c><see cref="System.Windows.Threading.Dispatcher"/></c> during instantiation.
|
||||
/// 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>
|
||||
|
@ -39,7 +39,7 @@ namespace Microsoft.ClearScript.Windows
|
|||
#region public members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="System.Windows.Threading.Dispatcher"/> associated with the current script engine.
|
||||
/// Gets the <c><see cref="System.Windows.Threading.Dispatcher"/></c> associated with the current script engine.
|
||||
/// </summary>
|
||||
public Dispatcher Dispatcher
|
||||
{
|
||||
|
|
|
@ -23,32 +23,32 @@ namespace Microsoft.ClearScript.Windows
|
|||
|
||||
/// <summary>
|
||||
/// Specifies that Just-In-Timestamp script debugging is to be enabled. This option is ignored
|
||||
/// if <see cref="EnableDebugging"/> is not specified.
|
||||
/// if <c><see cref="EnableDebugging"/></c> is not specified.
|
||||
/// </summary>
|
||||
EnableJITDebugging = 0x00000002,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that smart source document management is to be disabled. This option is
|
||||
/// ignored if <see cref="EnableDebugging"/> is not specified.
|
||||
/// ignored if <c><see cref="EnableDebugging"/></c> is not specified.
|
||||
/// </summary>
|
||||
DisableSourceManagement = 0x00000004,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that script language features that enhance standards compliance are to be
|
||||
/// enabled. This option only affects <see cref="Core.JScriptEngine"/>.
|
||||
/// enabled. This option only affects <c><see cref="Core.JScriptEngine"/></c>.
|
||||
/// </summary>
|
||||
EnableStandardsMode = 0x00000008,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that <c>null</c> is to be marshaled as a variant of type <c>VT_DISPATCH</c>.
|
||||
/// This option does not affect field, property, or method return values declared as
|
||||
/// <see cref="object"/>, <see cref="string"/>, nullable <see cref="bool"/>, or nullable
|
||||
/// <c><see cref="object"/></c>, <c><see cref="string"/></c>, nullable <c><see cref="bool"/></c>, or nullable
|
||||
/// numeric types.
|
||||
/// </summary>
|
||||
MarshalNullAsDispatch = 0x00000010,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that <see cref="decimal"/> values are to be marshaled as variants of type
|
||||
/// Specifies that <c><see cref="decimal"/></c> values are to be marshaled as variants of type
|
||||
/// <c>VT_CY</c>.
|
||||
/// </summary>
|
||||
MarshalDecimalAsCurrency = 0x00000020,
|
||||
|
@ -57,27 +57,27 @@ namespace Microsoft.ClearScript.Windows
|
|||
/// Specifies that managed arrays that are passed or returned to script code are to be
|
||||
/// converted to script arrays and marshaled as variants of type <c>VT_ARRAY</c>. In
|
||||
/// VBScript these objects are the native array type. JScript code can use the
|
||||
/// <see href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/y39d47w8(v=vs.84)">VBArray</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/y39d47w8(v=vs.84)">VBArray</see></c>
|
||||
/// object to access them.
|
||||
/// </summary>
|
||||
MarshalArraysByValue = 0x00000040,
|
||||
|
||||
/// <summary>
|
||||
/// When <see cref="EnableStandardsMode"/> is specified, the ClearScript library uses
|
||||
/// When <c><see cref="EnableStandardsMode"/></c> is specified, the ClearScript library uses
|
||||
/// virtual method table patching to support JScript-specific
|
||||
/// <see href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/sky96ah7(v=vs.94)">IDispatchEx</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/sky96ah7(v=vs.94)">IDispatchEx</see></c>
|
||||
/// extensions that otherwise interfere with some host object functionality. Virtual method
|
||||
/// table patching is a very low-level mechanism with global effect. This option specifies
|
||||
/// that virtual method table patching is not to be enabled on behalf of the current
|
||||
/// <see cref="Core.JScriptEngine"/> instance.
|
||||
/// <c><see cref="Core.JScriptEngine"/></c> instance.
|
||||
/// </summary>
|
||||
DoNotEnableVTablePatching = 0x00000080,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that <see cref="DateTime"/> values are to be marshaled as variants of type
|
||||
/// Specifies that <c><see cref="DateTime"/></c> values are to be marshaled as variants of type
|
||||
/// <c>VT_DATE</c>. In VBScript these objects are the native date-time type. JScript code
|
||||
/// can pass them to the
|
||||
/// <see href="https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/dca21baa(v=vs.100)">Date</see>
|
||||
/// <c><see href="https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/dca21baa(v=vs.100)">Date</see></c>
|
||||
/// constructor for property access.
|
||||
/// </summary>
|
||||
MarshalDateTimeAsDate = 0x00000100
|
||||
|
|
Двоичные данные
ClearScript/doc/Build.docx
Двоичные данные
ClearScript/doc/Build.docx
Двоичный файл не отображается.
Двоичные данные
ClearScript/doc/Reference.chm
Двоичные данные
ClearScript/doc/Reference.chm
Двоичный файл не отображается.
|
@ -11,6 +11,6 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.2.5")]
|
||||
[assembly: AssemblyFileVersion("7.2.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.2.5")]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
||||
|
|
|
@ -11,6 +11,6 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.2.5")]
|
||||
[assembly: AssemblyFileVersion("7.2.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.2.5")]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using Microsoft.ClearScript.V8;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace Microsoft.ClearScript.Test
|
||||
{
|
||||
[TestClass]
|
||||
public class BadV8DeploymentTest : ClearScriptTest
|
||||
{
|
||||
#region test methods
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
[TestMethod, TestCategory("BadV8Deployment")]
|
||||
public void BadV8Deployment_NoNativeLibrary()
|
||||
{
|
||||
GC.Collect();
|
||||
|
||||
V8Proxy.RunWithDeploymentDir("BadV8Deployment_NoNativeLibrary", () =>
|
||||
{
|
||||
var moduleNotFoundException = new Win32Exception(126 /*ERROR_MOD_NOT_FOUND*/);
|
||||
TypeLoadException caughtException = null;
|
||||
|
||||
try
|
||||
{
|
||||
using (new V8ScriptEngine())
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (TypeLoadException exception)
|
||||
{
|
||||
caughtException = exception;
|
||||
}
|
||||
catch (TargetInvocationException exception)
|
||||
{
|
||||
if (exception.InnerException is TypeLoadException typeLoadException)
|
||||
{
|
||||
caughtException = typeLoadException;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsNotNull(caughtException);
|
||||
Assert.IsTrue(caughtException.Message.Contains(moduleNotFoundException.Message));
|
||||
});
|
||||
}
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -1576,6 +1576,15 @@ namespace Microsoft.ClearScript.Test
|
|||
engine.Execute("connection.disconnect()");
|
||||
}
|
||||
|
||||
[TestMethod, TestCategory("BugFix")]
|
||||
public void BugFix_Exception_TargetSite_Reflection()
|
||||
{
|
||||
engine.AddHostType(typeof(SystemException));
|
||||
TestUtil.AssertException<UnauthorizedAccessException>(() => engine.Evaluate("new SystemException().TargetSite"));
|
||||
engine.AllowReflection = true;
|
||||
Assert.IsNull(engine.Evaluate("new SystemException().TargetSite"));
|
||||
}
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -11,6 +11,6 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("7.2.5")]
|
||||
[assembly: AssemblyFileVersion("7.2.5")]
|
||||
[assembly: AssemblyInformationalVersion("7.2.5")]
|
||||
[assembly: AssemblyVersion("7.3.0")]
|
||||
[assembly: AssemblyFileVersion("7.3.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.3.0")]
|
||||
|
|
|
@ -2136,6 +2136,32 @@ namespace Microsoft.ClearScript.Test
|
|||
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("bar()")));
|
||||
}
|
||||
|
||||
[TestMethod, TestCategory("V8ScriptEngine")]
|
||||
public void V8ScriptEngine_ExceptionMarshaling_Suppression()
|
||||
{
|
||||
engine.Dispose();
|
||||
engine = new V8ScriptEngine(V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.HideHostExceptions);
|
||||
|
||||
Exception exception = new IOException("something awful happened");
|
||||
engine.AddRestrictedHostObject("exception", exception);
|
||||
|
||||
engine.Script.foo = new Action(() => throw exception);
|
||||
|
||||
engine.Execute(@"
|
||||
function bar() {
|
||||
try {
|
||||
foo();
|
||||
return false;
|
||||
}
|
||||
catch (ex) {
|
||||
return typeof ex.hostException === 'undefined';
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
Assert.IsTrue(Convert.ToBoolean(engine.Evaluate("bar()")));
|
||||
}
|
||||
|
||||
[TestMethod, TestCategory("V8ScriptEngine")]
|
||||
public void V8ScriptEngine_Current()
|
||||
{
|
||||
|
@ -2763,39 +2789,52 @@ namespace Microsoft.ClearScript.Test
|
|||
{
|
||||
engine.Script.foo = new Random();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
Assert.AreEqual("function", engine.Evaluate("typeof foo.ToString"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo.ToString === 'function'"));
|
||||
|
||||
engine.Script.foo = Enumerable.Range(0, 5).ToArray();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
|
||||
engine.Script.foo = new ArrayList();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
|
||||
engine.Script.foo = new BitArray(100);
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
|
||||
engine.Script.foo = new Hashtable();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
|
||||
engine.Script.foo = new Queue();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
|
||||
engine.Script.foo = new SortedList();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
|
||||
engine.Script.foo = new Stack();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
|
||||
engine.Script.foo = new List<string>();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
Assert.AreEqual("function", engine.Evaluate("typeof foo.Item"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo.Item === 'function'"));
|
||||
|
||||
engine.Script.foo = new ExpandoObject();
|
||||
engine.Script.host = new HostFunctions();
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof foo"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof foo === 'object'"));
|
||||
Assert.AreEqual("object", engine.Evaluate("typeof host.toStaticType(foo)"));
|
||||
Assert.IsTrue((bool)engine.Evaluate("typeof host.toStaticType(foo) === 'object'"));
|
||||
}
|
||||
|
||||
|
||||
[TestMethod, TestCategory("V8ScriptEngine")]
|
||||
public void V8ScriptEngine_ArrayInvocability()
|
||||
{
|
||||
|
@ -3821,6 +3860,28 @@ namespace Microsoft.ClearScript.Test
|
|||
}
|
||||
}
|
||||
|
||||
[TestMethod, TestCategory("V8ScriptEngine")]
|
||||
public void V8ScriptEngine_StringifyEnhancements()
|
||||
{
|
||||
engine.Script.hostObject = new Dictionary<string, object> { { "foo", 123 }, { "bar", "baz" }, { "qux", engine.Evaluate("({ quux: 456.789, quuz: 'corge' })") } };
|
||||
Assert.IsInstanceOfType(engine.Evaluate("JSON.stringify(hostObject)"), typeof(Undefined));
|
||||
|
||||
engine.Execute("scriptObject = { grault: null, garply: hostObject }");
|
||||
Assert.AreEqual("{\"grault\":null}", engine.Evaluate("JSON.stringify(scriptObject)"));
|
||||
|
||||
engine.Dispose();
|
||||
engine = new V8ScriptEngine(V8ScriptEngineFlags.EnableDebugging | V8ScriptEngineFlags.EnableStringifyEnhancements);
|
||||
|
||||
engine.Script.hostObject = new Dictionary<string, object> { { "foo", 123 }, { "bar", "baz" }, { "qux", engine.Evaluate("({ quux: 456.789, quuz: 'corge' })") } };
|
||||
Assert.AreEqual("{\"foo\":123,\"bar\":\"baz\",\"qux\":{\"quux\":456.789,\"quuz\":\"corge\"}}", engine.Evaluate("JSON.stringify(hostObject)"));
|
||||
|
||||
engine.Execute("scriptObject = { grault: null, garply: hostObject }");
|
||||
Assert.AreEqual("{\"grault\":null,\"garply\":{\"foo\":123,\"bar\":\"baz\",\"qux\":{\"quux\":456.789,\"quuz\":\"corge\"}}}", engine.Evaluate("JSON.stringify(scriptObject)"));
|
||||
|
||||
engine.Execute("hostObject.Add('jerry', scriptObject)");
|
||||
TestUtil.AssertException<InvalidOperationException>(() => engine.Evaluate("JSON.stringify(hostObject)"));
|
||||
}
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -18,6 +18,7 @@ public:
|
|||
bool DisableGlobalMembers = true;
|
||||
bool EnableDateTimeConversion = false;
|
||||
bool EnableDynamicModuleImports = false;
|
||||
bool HideHostExceptions = false;
|
||||
int DebugPort = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -230,6 +230,7 @@ V8ContextImpl::V8ContextImpl(SharedPtr<V8IsolateImpl>&& spIsolateImpl, const Std
|
|||
m_Name(name),
|
||||
m_spIsolateImpl(std::move(spIsolateImpl)),
|
||||
m_DateTimeConversionEnabled(options.EnableDateTimeConversion),
|
||||
m_HideHostExceptions(options.HideHostExceptions),
|
||||
m_pvV8ObjectCache(nullptr),
|
||||
m_AllowHostObjectConstructorCall(false)
|
||||
{
|
||||
|
@ -262,59 +263,67 @@ V8ContextImpl::V8ContextImpl(SharedPtr<V8IsolateImpl>&& spIsolateImpl, const Std
|
|||
|
||||
v8::Local<v8::FunctionTemplate> hGetIteratorFunction;
|
||||
v8::Local<v8::FunctionTemplate> hGetAsyncIteratorFunction;
|
||||
v8::Local<v8::FunctionTemplate> hGetJsonFunction;
|
||||
v8::Local<v8::FunctionTemplate> hToFunctionFunction;
|
||||
|
||||
BEGIN_CONTEXT_SCOPE
|
||||
|
||||
m_hIsHostObjectKey = CreatePersistent(CreateSymbol());
|
||||
FROM_MAYBE(m_hContext->Global()->Set(m_hContext, FROM_MAYBE(CreateString(StdString(SL("isHostObjectKey")))), m_hIsHostObjectKey));
|
||||
FROM_MAYBE(m_hContext->Global()->Set(m_hContext, CreateString("isHostObjectKey"), m_hIsHostObjectKey));
|
||||
|
||||
m_hHostExceptionKey = CreatePersistent(FROM_MAYBE(CreateString(StdString(SL("hostException")))));
|
||||
m_hHostExceptionKey = CreatePersistent(CreateString("hostException"));
|
||||
m_hCacheKey = CreatePersistent(CreatePrivate());
|
||||
m_hAccessTokenKey = CreatePersistent(CreatePrivate());
|
||||
m_hInternalUseOnly = CreatePersistent(FROM_MAYBE(CreateString(StdString(SL("The invoked function is for ClearScript internal use only")))));
|
||||
m_hStackKey = CreatePersistent(FROM_MAYBE(CreateString(StdString(SL("stack")))));
|
||||
m_hObjectNotInvocable = CreatePersistent(FROM_MAYBE(CreateString(StdString(SL("The object does not support invocation")))));
|
||||
m_hMethodOrPropertyNotFound = CreatePersistent(FROM_MAYBE(CreateString(StdString(SL("Method or property not found")))));
|
||||
m_hPropertyValueNotInvocable = CreatePersistent(FROM_MAYBE(CreateString(StdString(SL("Property value does not support invocation")))));
|
||||
m_hInvalidModuleRequest = CreatePersistent(FROM_MAYBE(CreateString(StdString(SL("Invalid module load request")))));
|
||||
m_hInternalUseOnly = CreatePersistent(CreateString("The invoked function is for ClearScript internal use only"));
|
||||
m_hStackKey = CreatePersistent(CreateString("stack"));
|
||||
m_hObjectNotInvocable = CreatePersistent(CreateString("The object does not support invocation"));
|
||||
m_hMethodOrPropertyNotFound = CreatePersistent(CreateString("Method or property not found"));
|
||||
m_hPropertyValueNotInvocable = CreatePersistent(CreateString("Property value does not support invocation"));
|
||||
m_hInvalidModuleRequest = CreatePersistent(CreateString("Invalid module load request"));
|
||||
|
||||
hGetIteratorFunction = CreateFunctionTemplate(GetHostObjectIterator, hContextImpl);
|
||||
hGetAsyncIteratorFunction = CreateFunctionTemplate(GetHostObjectAsyncIterator, hContextImpl);
|
||||
hGetJsonFunction = CreateFunctionTemplate(GetHostObjectJson, hContextImpl);
|
||||
hToFunctionFunction = CreateFunctionTemplate(CreateFunctionForHostDelegate, hContextImpl);
|
||||
|
||||
m_hAccessToken = CreatePersistent(CreateObject());
|
||||
m_hFlushFunction = CreatePersistent(FROM_MAYBE(v8::Function::New(m_hContext, FlushCallback)));
|
||||
m_hTerminationException = CreatePersistent(v8::Exception::Error(FROM_MAYBE(CreateString(StdString(SL("Script execution was interrupted"))))));
|
||||
m_hTerminationException = CreatePersistent(v8::Exception::Error(CreateString("Script execution was interrupted")));
|
||||
|
||||
END_CONTEXT_SCOPE
|
||||
|
||||
auto hToJSON = CreateString("toJSON");
|
||||
|
||||
m_hHostObjectTemplate = CreatePersistent(CreateFunctionTemplate());
|
||||
m_hHostObjectTemplate->SetClassName(FROM_MAYBE(CreateString(StdString(SL("HostObject")))));
|
||||
m_hHostObjectTemplate->SetClassName(CreateString("HostObject"));
|
||||
m_hHostObjectTemplate->SetCallHandler(HostObjectConstructorCallHandler, hContextImpl);
|
||||
m_hHostObjectTemplate->InstanceTemplate()->SetHandler(v8::NamedPropertyHandlerConfiguration(GetHostObjectProperty, SetHostObjectProperty, QueryHostObjectProperty, DeleteHostObjectProperty, GetHostObjectPropertyNames, hContextImpl, v8::PropertyHandlerFlags::kNone));
|
||||
m_hHostObjectTemplate->InstanceTemplate()->SetHandler(v8::IndexedPropertyHandlerConfiguration(GetHostObjectProperty, SetHostObjectProperty, QueryHostObjectProperty, DeleteHostObjectProperty, GetHostObjectPropertyIndices, hContextImpl));
|
||||
m_hHostObjectTemplate->PrototypeTemplate()->Set(GetIteratorSymbol(), hGetIteratorFunction);
|
||||
m_hHostObjectTemplate->PrototypeTemplate()->Set(GetAsyncIteratorSymbol(), hGetAsyncIteratorFunction);
|
||||
m_hHostObjectTemplate->PrototypeTemplate()->Set(hToJSON, hGetJsonFunction);
|
||||
|
||||
m_hHostInvocableTemplate = CreatePersistent(CreateFunctionTemplate());
|
||||
m_hHostInvocableTemplate->SetClassName(FROM_MAYBE(CreateString(StdString(SL("HostInvocable")))));
|
||||
m_hHostInvocableTemplate->SetClassName(CreateString("HostInvocable"));
|
||||
m_hHostInvocableTemplate->SetCallHandler(HostObjectConstructorCallHandler, hContextImpl);
|
||||
m_hHostInvocableTemplate->InstanceTemplate()->SetHandler(v8::NamedPropertyHandlerConfiguration(GetHostObjectProperty, SetHostObjectProperty, QueryHostObjectProperty, DeleteHostObjectProperty, GetHostObjectPropertyNames, hContextImpl, v8::PropertyHandlerFlags::kNone));
|
||||
m_hHostInvocableTemplate->InstanceTemplate()->SetHandler(v8::IndexedPropertyHandlerConfiguration(GetHostObjectProperty, SetHostObjectProperty, QueryHostObjectProperty, DeleteHostObjectProperty, GetHostObjectPropertyIndices, hContextImpl));
|
||||
m_hHostInvocableTemplate->PrototypeTemplate()->Set(GetIteratorSymbol(), hGetIteratorFunction);
|
||||
m_hHostInvocableTemplate->PrototypeTemplate()->Set(GetAsyncIteratorSymbol(), hGetAsyncIteratorFunction);
|
||||
m_hHostInvocableTemplate->PrototypeTemplate()->Set(hToJSON, hGetJsonFunction);
|
||||
m_hHostInvocableTemplate->InstanceTemplate()->SetCallAsFunctionHandler(InvokeHostObject, hContextImpl);
|
||||
|
||||
m_hHostDelegateTemplate = CreatePersistent(CreateFunctionTemplate());
|
||||
m_hHostDelegateTemplate->SetClassName(FROM_MAYBE(CreateString(StdString(SL("HostDelegate")))));
|
||||
m_hHostDelegateTemplate->SetClassName(CreateString("HostDelegate"));
|
||||
m_hHostDelegateTemplate->SetCallHandler(HostObjectConstructorCallHandler, hContextImpl);
|
||||
m_hHostDelegateTemplate->InstanceTemplate()->SetHandler(v8::NamedPropertyHandlerConfiguration(GetHostObjectProperty, SetHostObjectProperty, QueryHostObjectProperty, DeleteHostObjectProperty, GetHostObjectPropertyNames, hContextImpl, v8::PropertyHandlerFlags::kNone));
|
||||
m_hHostDelegateTemplate->InstanceTemplate()->SetHandler(v8::IndexedPropertyHandlerConfiguration(GetHostObjectProperty, SetHostObjectProperty, QueryHostObjectProperty, DeleteHostObjectProperty, GetHostObjectPropertyIndices, hContextImpl));
|
||||
m_hHostDelegateTemplate->PrototypeTemplate()->Set(GetIteratorSymbol(), hGetIteratorFunction);
|
||||
m_hHostDelegateTemplate->PrototypeTemplate()->Set(GetAsyncIteratorSymbol(), hGetAsyncIteratorFunction);
|
||||
m_hHostDelegateTemplate->PrototypeTemplate()->Set(hToJSON, hGetJsonFunction);
|
||||
m_hHostDelegateTemplate->InstanceTemplate()->SetCallAsFunctionHandler(InvokeHostObject, hContextImpl);
|
||||
m_hHostDelegateTemplate->InstanceTemplate()->SetHostDelegate(); // instructs our patched V8 typeof implementation to return "function"
|
||||
m_hHostDelegateTemplate->PrototypeTemplate()->Set(FROM_MAYBE(CreateString(StdString(SL("toFunction")))), hToFunctionFunction);
|
||||
m_hHostDelegateTemplate->PrototypeTemplate()->Set(CreateString("toFunction"), hToFunctionFunction);
|
||||
|
||||
m_pvV8ObjectCache = HostObjectUtil::GetInstance().CreateV8ObjectCache();
|
||||
m_spIsolateImpl->AddContext(this, options);
|
||||
|
@ -1577,6 +1586,7 @@ void V8ContextImpl::Teardown()
|
|||
Dispose(it->second);
|
||||
}
|
||||
|
||||
Dispose(m_hToJsonFunction);
|
||||
Dispose(m_hToAsyncIteratorFunction);
|
||||
Dispose(m_hToIteratorFunction);
|
||||
Dispose(m_hHostDelegateTemplate);
|
||||
|
@ -2153,12 +2163,11 @@ void V8ContextImpl::GetHostObjectIterator(const v8::FunctionCallbackInfo<v8::Val
|
|||
{
|
||||
if (pContextImpl->m_hToIteratorFunction.IsEmpty())
|
||||
{
|
||||
auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hContext->Global()->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("EngineInternal")))))).As<v8::Object>();
|
||||
pContextImpl->m_hToIteratorFunction = pContextImpl->CreatePersistent(FROM_MAYBE(hEngineInternal->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("toIterator")))))).As<v8::Function>());
|
||||
auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hContext->Global()->Get(pContextImpl->m_hContext, pContextImpl->CreateString("EngineInternal"))).As<v8::Object>();
|
||||
pContextImpl->m_hToIteratorFunction = pContextImpl->CreatePersistent(FROM_MAYBE(hEngineInternal->Get(pContextImpl->m_hContext, pContextImpl->CreateString("toIterator"))).As<v8::Function>());
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> args[1];
|
||||
args[0] = pContextImpl->ImportValue(HostObjectUtil::GetInstance().GetEnumerator(pvObject));
|
||||
v8::Local<v8::Value> args[] = { pContextImpl->ImportValue(HostObjectUtil::GetInstance().GetEnumerator(pvObject)) };
|
||||
CALLBACK_RETURN(FROM_MAYBE(pContextImpl->m_hToIteratorFunction->Call(pContextImpl->m_hContext, pContextImpl->GetUndefined(), 1, args)));
|
||||
}
|
||||
catch (const HostException& exception)
|
||||
|
@ -2187,12 +2196,11 @@ void V8ContextImpl::GetHostObjectAsyncIterator(const v8::FunctionCallbackInfo<v8
|
|||
{
|
||||
if (pContextImpl->m_hToAsyncIteratorFunction.IsEmpty())
|
||||
{
|
||||
auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hContext->Global()->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("EngineInternal")))))).As<v8::Object>();
|
||||
pContextImpl->m_hToAsyncIteratorFunction = pContextImpl->CreatePersistent(FROM_MAYBE(hEngineInternal->Get(pContextImpl->m_hContext, FROM_MAYBE(pContextImpl->CreateString(StdString(SL("toAsyncIterator")))))).As<v8::Function>());
|
||||
auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hContext->Global()->Get(pContextImpl->m_hContext, pContextImpl->CreateString("EngineInternal"))).As<v8::Object>();
|
||||
pContextImpl->m_hToAsyncIteratorFunction = pContextImpl->CreatePersistent(FROM_MAYBE(hEngineInternal->Get(pContextImpl->m_hContext, pContextImpl->CreateString("toAsyncIterator"))).As<v8::Function>());
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> args[1];
|
||||
args[0] = pContextImpl->ImportValue(HostObjectUtil::GetInstance().GetAsyncEnumerator(pvObject));
|
||||
v8::Local<v8::Value> args[] = { pContextImpl->ImportValue(HostObjectUtil::GetInstance().GetAsyncEnumerator(pvObject)) };
|
||||
CALLBACK_RETURN(FROM_MAYBE(pContextImpl->m_hToAsyncIteratorFunction->Call(pContextImpl->m_hContext, pContextImpl->GetUndefined(), 1, args)));
|
||||
}
|
||||
catch (const HostException& exception)
|
||||
|
@ -2207,6 +2215,41 @@ void V8ContextImpl::GetHostObjectAsyncIterator(const v8::FunctionCallbackInfo<v8
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void V8ContextImpl::GetHostObjectJson(const v8::FunctionCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
FROM_MAYBE_TRY
|
||||
|
||||
auto pContextImpl = ::GetContextImplFromData(info);
|
||||
if (pContextImpl != nullptr)
|
||||
{
|
||||
auto hObject = info.Holder();
|
||||
if (pContextImpl->GetHostObject(hObject) != nullptr)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pContextImpl->m_hToJsonFunction.IsEmpty())
|
||||
{
|
||||
auto hEngineInternal = FROM_MAYBE(pContextImpl->m_hContext->Global()->Get(pContextImpl->m_hContext, pContextImpl->CreateString("EngineInternal"))).As<v8::Object>();
|
||||
pContextImpl->m_hToJsonFunction = pContextImpl->CreatePersistent(FROM_MAYBE(hEngineInternal->Get(pContextImpl->m_hContext, pContextImpl->CreateString("toJson"))).As<v8::Function>());
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> args[] = { info[0], hObject };
|
||||
CALLBACK_RETURN(FROM_MAYBE(pContextImpl->m_hToJsonFunction->Call(pContextImpl->m_hContext, pContextImpl->GetUndefined(), 2, args)));
|
||||
}
|
||||
catch (const HostException& exception)
|
||||
{
|
||||
pContextImpl->ThrowScriptException(exception);
|
||||
}
|
||||
}
|
||||
|
||||
CALLBACK_RETURN(hObject);
|
||||
}
|
||||
|
||||
FROM_MAYBE_CATCH_CONSUME
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void V8ContextImpl::CreateFunctionForHostDelegate(const v8::FunctionCallbackInfo<v8::Value>& info)
|
||||
{
|
||||
FROM_MAYBE_TRY
|
||||
|
@ -3403,10 +3446,13 @@ void V8ContextImpl::ThrowScriptException(const HostException& exception)
|
|||
auto hException = v8::Exception::Error(FROM_MAYBE(CreateString(exception.GetMessage()))).As<v8::Object>();
|
||||
if (!hException.IsEmpty() && hException->IsObject())
|
||||
{
|
||||
auto hHostException = ImportValue(exception.GetException());
|
||||
if (!hHostException.IsEmpty() && hHostException->IsObject())
|
||||
if (!m_HideHostExceptions)
|
||||
{
|
||||
ASSERT_EVAL(FROM_MAYBE(hException->Set(m_hContext, m_hHostExceptionKey, hHostException)));
|
||||
auto hHostException = ImportValue(exception.GetException());
|
||||
if (!hHostException.IsEmpty() && hHostException->IsObject())
|
||||
{
|
||||
ASSERT_EVAL(FROM_MAYBE(hException->Set(m_hContext, m_hHostExceptionKey, hHostException)));
|
||||
}
|
||||
}
|
||||
|
||||
ThrowException(hException);
|
||||
|
|
|
@ -194,6 +194,12 @@ private:
|
|||
return m_spIsolateImpl->CreateString(value, type);
|
||||
}
|
||||
|
||||
template <int N>
|
||||
v8::Local<v8::String> CreateString(const char (&value)[N], v8::NewStringType type = v8::NewStringType::kNormal)
|
||||
{
|
||||
return m_spIsolateImpl->CreateString(value, type);
|
||||
}
|
||||
|
||||
virtual StdString CreateStdString(v8::Local<v8::Value> hValue) override
|
||||
{
|
||||
return m_spIsolateImpl->CreateStdString(hValue);
|
||||
|
@ -402,6 +408,7 @@ private:
|
|||
static void HostObjectConstructorCallHandler(const v8::FunctionCallbackInfo<v8::Value>& info);
|
||||
static void GetHostObjectIterator(const v8::FunctionCallbackInfo<v8::Value>& info);
|
||||
static void GetHostObjectAsyncIterator(const v8::FunctionCallbackInfo<v8::Value>& info);
|
||||
static void GetHostObjectJson(const v8::FunctionCallbackInfo<v8::Value>& info);
|
||||
static void CreateFunctionForHostDelegate(const v8::FunctionCallbackInfo<v8::Value>& info);
|
||||
static void InvokeHostDelegate(const v8::FunctionCallbackInfo<v8::Value>& info);
|
||||
|
||||
|
@ -447,6 +454,7 @@ private:
|
|||
StdString m_Name;
|
||||
SharedPtr<V8IsolateImpl> m_spIsolateImpl;
|
||||
bool m_DateTimeConversionEnabled;
|
||||
bool m_HideHostExceptions;
|
||||
Persistent<v8::Context> m_hContext;
|
||||
std::vector<std::pair<StdString, Persistent<v8::Object>>> m_GlobalMembersStack;
|
||||
Persistent<v8::Symbol> m_hIsHostObjectKey;
|
||||
|
@ -465,6 +473,7 @@ private:
|
|||
Persistent<v8::FunctionTemplate> m_hHostDelegateTemplate;
|
||||
Persistent<v8::Function> m_hToIteratorFunction;
|
||||
Persistent<v8::Function> m_hToAsyncIteratorFunction;
|
||||
Persistent<v8::Function> m_hToJsonFunction;
|
||||
Persistent<v8::Function> m_hFlushFunction;
|
||||
Persistent<v8::Value> m_hTerminationException;
|
||||
SharedPtr<V8WeakContextBinding> m_spWeakBinding;
|
||||
|
|
|
@ -227,6 +227,12 @@ public:
|
|||
return value.ToV8String(m_upIsolate.get(), type);
|
||||
}
|
||||
|
||||
template <int N>
|
||||
v8::Local<v8::String> CreateString(const char (&value)[N], v8::NewStringType type = v8::NewStringType::kNormal)
|
||||
{
|
||||
return v8::String::NewFromUtf8Literal(m_upIsolate.get(), value, type);
|
||||
}
|
||||
|
||||
virtual StdString CreateStdString(v8::Local<v8::Value> hValue) override
|
||||
{
|
||||
return StdString(m_upIsolate.get(), hValue);
|
||||
|
|
|
@ -116,10 +116,9 @@ NATIVE_ENTRY_POINT(void**) V8SplitProxyManaged_SetMethodTable(void** pMethodTabl
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
NATIVE_ENTRY_POINT(void) V8Environment_InitializeICU(const StdChar* pDataPath) noexcept
|
||||
NATIVE_ENTRY_POINT(void) V8Environment_InitializeICU(const char* pICUData, uint32_t size) noexcept
|
||||
{
|
||||
StdString dataPath(pDataPath);
|
||||
ASSERT_EVAL(v8::V8::InitializeICU(dataPath.ToUTF8().c_str()));
|
||||
ASSERT_EVAL(v8::V8::InitializeICU(pICUData, size));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -722,7 +721,7 @@ NATIVE_ENTRY_POINT(V8IsolateHandle*) V8Isolate_Create(const StdString& name, int
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
NATIVE_ENTRY_POINT(V8ContextHandle*) V8Isolate_CreateContext(const V8IsolateHandle& handle, const StdString& name, StdBool enableDebugging, StdBool enableRemoteDebugging, StdBool disableGlobalMembers, StdBool enableDateTimeConversion, StdBool enableDynamicModuleImports, int32_t debugPort) noexcept
|
||||
NATIVE_ENTRY_POINT(V8ContextHandle*) V8Isolate_CreateContext(const V8IsolateHandle& handle, const StdString& name, StdBool enableDebugging, StdBool enableRemoteDebugging, StdBool disableGlobalMembers, StdBool enableDateTimeConversion, StdBool enableDynamicModuleImports, StdBool hideHostExceptions, int32_t debugPort) noexcept
|
||||
{
|
||||
auto spIsolate = handle.GetEntity();
|
||||
if (!spIsolate.IsEmpty())
|
||||
|
@ -733,6 +732,7 @@ NATIVE_ENTRY_POINT(V8ContextHandle*) V8Isolate_CreateContext(const V8IsolateHand
|
|||
options.DisableGlobalMembers = disableGlobalMembers;
|
||||
options.EnableDateTimeConversion = enableDateTimeConversion;
|
||||
options.EnableDynamicModuleImports = enableDynamicModuleImports;
|
||||
options.HideHostExceptions = hideHostExceptions;
|
||||
options.DebugPort = debugPort;
|
||||
|
||||
try
|
||||
|
|
|
@ -157,7 +157,7 @@ DEFINE_V8_ENTITY_HANDLE(NativeCallbackHandle, IHostObjectUtil::NativeCallback, S
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
NATIVE_ENTRY_POINT(void**) V8SplitProxyManaged_SetMethodTable(void** pMethodTable) noexcept;
|
||||
NATIVE_ENTRY_POINT(void) V8Environment_InitializeICU(const StdChar* pDataPath) noexcept;
|
||||
NATIVE_ENTRY_POINT(void) V8Environment_InitializeICU(const char* pICUData, uint32_t size) noexcept;
|
||||
|
||||
NATIVE_ENTRY_POINT(StdString*) StdString_New(const StdChar* pValue, int32_t length) noexcept;
|
||||
NATIVE_ENTRY_POINT(const StdChar*) StdString_GetValue(const StdString& string, int32_t& length) noexcept;
|
||||
|
@ -230,7 +230,7 @@ NATIVE_ENTRY_POINT(StdBool) V8CpuProfileNode_GetHitLines(const v8::CpuProfileNod
|
|||
NATIVE_ENTRY_POINT(const v8::CpuProfileNode*) V8CpuProfileNode_GetChildNode(const v8::CpuProfileNode& node, int32_t index) noexcept;
|
||||
|
||||
NATIVE_ENTRY_POINT(V8IsolateHandle*) V8Isolate_Create(const StdString& name, int32_t maxNewSpaceSize, int32_t maxOldSpaceSize, double heapExpansionMultiplier, uint64_t maxArrayBufferAllocation, StdBool enableDebugging, StdBool enableRemoteDebugging, StdBool enableDynamicModuleImports, int32_t debugPort) noexcept;
|
||||
NATIVE_ENTRY_POINT(V8ContextHandle*) V8Isolate_CreateContext(const V8IsolateHandle& handle, const StdString& name, StdBool enableDebugging, StdBool enableRemoteDebugging, StdBool disableGlobalMembers, StdBool enableDateTimeConversion, StdBool enableDynamicModuleImports, int32_t debugPort) noexcept;
|
||||
NATIVE_ENTRY_POINT(V8ContextHandle*) V8Isolate_CreateContext(const V8IsolateHandle& handle, const StdString& name, StdBool enableDebugging, StdBool enableRemoteDebugging, StdBool disableGlobalMembers, StdBool enableDateTimeConversion, StdBool enableDynamicModuleImports, StdBool hideHostExceptions, int32_t debugPort) noexcept;
|
||||
NATIVE_ENTRY_POINT(size_t) V8Isolate_GetMaxHeapSize(const V8IsolateHandle& handle) noexcept;
|
||||
NATIVE_ENTRY_POINT(void) V8Isolate_SetMaxHeapSize(const V8IsolateHandle& handle, size_t size) noexcept;
|
||||
NATIVE_ENTRY_POINT(double) V8Isolate_GetHeapSizeSampleInterval(const V8IsolateHandle& handle) noexcept;
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
<Compile Include="..\..\ClearScript\V8\V8RuntimeHeapInfo.cs" Link="V8\V8RuntimeHeapInfo.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8Script.cs" Link="V8\V8Script.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptEngine.cs" Link="V8\V8ScriptEngine.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptEngine.InitScript.cs" Link="V8\V8ScriptEngine.InitScript.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptEngine.NetStandard.cs" Link="V8\V8ScriptEngine.NetStandard.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptEngineFlags.cs" Link="V8\V8ScriptEngineFlags.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptItem.cs" Link="V8\V8ScriptItem.cs" />
|
||||
|
@ -77,17 +78,6 @@
|
|||
<Compile Include="..\..\ClearScript\V8\V8TestProxy.cs" Link="V8\V8TestProxy.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Condition="Exists('..\..\V8\build\v8\third_party\icu\common\icudtl.dat')" Include="..\..\V8\build\v8\third_party\icu\common\icudtl.dat" Link="ClearScriptV8.ICU.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Visible>false</Visible>
|
||||
</None>
|
||||
<None Condition="!Exists('..\..\V8\build\v8\third_party\icu\common\icudtl.dat') And Exists('..\..\V8\ClearScriptV8.ICU.dat')" Include="..\..\V8\ClearScriptV8.ICU.dat" Link="ClearScriptV8.ICU.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Visible>false</Visible>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'">
|
||||
<None Include="..\..\bin\$(Configuration)\ClearScriptV8.win-x86.dll" Link="ClearScriptV8.win-x86.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
@ -147,8 +137,13 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ClearScript.Core\ClearScript.Core.csproj" />
|
||||
<ProjectReference Include="..\..\NetStandard\ClearScript.V8.ICUData\ClearScript.V8.ICUData.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
<Compile Include="..\..\ClearScript\Windows\Core\NullSyncInvoker.cs" Link="Windows\Core\NullSyncInvoker.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\IWindowsScriptObject.cs" Link="Windows\IWindowsScriptObject.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\JScriptEngine.cs" Link="Windows\Core\JScriptEngine.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\JScriptEngine.InitScript.cs" Link="Windows\Core\JScriptEngine.InitScript.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\JScriptEngine.NetStandard.cs" Link="Windows\Core\JScriptEngine.NetStandard.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Nothing.cs" Link="Windows\Nothing.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\VBScriptEngine.cs" Link="Windows\Core\VBScriptEngine.cs" />
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.9" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -123,14 +123,14 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.9" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.9" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.1.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -195,9 +195,12 @@
|
|||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -77,6 +77,11 @@
|
|||
<Compile Include="..\..\ClearScript\V8\V8RuntimeHeapInfo.cs" Link="V8\V8RuntimeHeapInfo.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8Script.cs" Link="V8\V8Script.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptEngine.cs" Link="V8\V8ScriptEngine.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptEngine.InitScript.cs" Link="V8\V8ScriptEngine.InitScript.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>V8ScriptEngine.InitScript.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptEngineFlags.cs" Link="V8\V8ScriptEngineFlags.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8ScriptItem.cs" Link="V8\V8ScriptItem.cs" />
|
||||
<Compile Include="..\..\ClearScript\V8\V8Settings.cs" Link="V8\V8Settings.cs" />
|
||||
|
@ -88,21 +93,16 @@
|
|||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>AssemblyInfo.V8.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="..\..\ClearScript\V8\V8ScriptEngine.InitScript.tt" Link="V8\V8ScriptEngine.InitScript.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>V8ScriptEngine.InitScript.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="..\..\ClearScript\V8\V8ScriptEngine.InitScript.js" Link="V8\V8ScriptEngine.InitScript.js"/>
|
||||
<None Include="..\..\ClearScript\V8\SplitProxy\V8SplitProxyNative.tt" Link="V8\SplitProxy\V8SplitProxyNative.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>V8SplitProxyNative.Generated.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Condition="Exists('..\..\V8\build\v8\third_party\icu\common\icudtl.dat')" Include="..\..\V8\build\v8\third_party\icu\common\icudtl.dat" Link="ClearScriptV8.ICU.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Visible>false</Visible>
|
||||
</None>
|
||||
<None Condition="!Exists('..\..\V8\build\v8\third_party\icu\common\icudtl.dat') And Exists('..\..\V8\ClearScriptV8.ICU.dat')" Include="..\..\V8\ClearScriptV8.ICU.dat" Link="ClearScriptV8.ICU.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Visible>false</Visible>
|
||||
</None>
|
||||
<None Include="..\..\ClearScript\V8\SplitProxy\V8SplitProxyNative.Common.tt" Link="V8\SplitProxy\V8SplitProxyNative.Common.tt"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'">
|
||||
|
@ -168,8 +168,13 @@
|
|||
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ClearScript.Core\ClearScript.Core.csproj" />
|
||||
<ProjectReference Include="..\..\NetStandard\ClearScript.V8.ICUData\ClearScript.V8.ICUData.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -46,6 +46,11 @@
|
|||
<Compile Include="..\..\ClearScript\Windows\Core\NullSyncInvoker.cs" Link="Windows\Core\NullSyncInvoker.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\IWindowsScriptObject.cs" Link="Windows\IWindowsScriptObject.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\JScriptEngine.cs" Link="Windows\Core\JScriptEngine.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\JScriptEngine.InitScript.cs" Link="Windows\Core\JScriptEngine.InitScript.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>JScriptEngine.InitScript.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="..\..\ClearScript\Windows\Nothing.cs" Link="Windows\Nothing.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\VBScriptEngine.cs" Link="Windows\Core\VBScriptEngine.cs" />
|
||||
<Compile Include="..\..\ClearScript\Windows\Core\WindowsScriptEngine.cs" Link="Windows\Core\WindowsScriptEngine.cs" />
|
||||
|
@ -60,6 +65,11 @@
|
|||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>AssemblyInfo.Windows.Core.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="..\..\ClearScript\Windows\Core\JScriptEngine.InitScript.tt" Link="Windows\Core\JScriptEngine.InitScript.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>JScriptEngine.InitScript.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="..\..\ClearScript\Windows\Core\JScriptEngine.InitScript.js" Link="Windows\Core\JScriptEngine.InitScript.js"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\ClearScriptTest\AccessContextTest.cs" Link="AccessContextTest.cs" />
|
||||
<Compile Include="..\..\ClearScriptTest\BadV8DeploymentTest.cs" Link="BadV8DeploymentTest.cs" />
|
||||
<Compile Include="..\..\ClearScriptTest\BaseInterfaceMemberAccessTest.cs" Link="BaseInterfaceMemberAccessTest.cs" />
|
||||
<Compile Include="..\..\ClearScriptTest\BaseMemberAccessTest.cs" Link="BaseMemberAccessTest.cs" />
|
||||
<Compile Include="..\..\ClearScriptTest\BaseTestObject.cs" Link="BaseTestObject.cs" />
|
||||
|
@ -120,10 +119,10 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.0.3">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче