Skip to content

Commit 18710eb

Browse files
Version 5.5.1: Switched to custom WebSocket implementation for V8 Inspector; added V8ScriptEngineFlags.AwaitDebuggerAndPauseOnStart (GitHub Issue #22); added ToString() overrides to exception classes (GitHub Issue #16); updated debugging and API documentation. Tested with V8 6.3.292.48 + infinite loop fix (GitHub Issue #33).
1 parent d9506f6 commit 18710eb

File tree

451 files changed

+2173
-1030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

451 files changed

+2173
-1030
lines changed

ClearScript.NoV8.sln.DotSettings

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String>
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp50</s:String>
33
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ecpp/@EntryIndexedValue">True</s:Boolean>
44
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Eh/@EntryIndexedValue">True</s:Boolean>
55
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue">DO_NOT_SHOW</s:String>
@@ -22,6 +22,7 @@
2222
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
2323
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>
2424
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_TYPEOF_PARENTHESES/@EntryValue">False</s:Boolean>
25+
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHING_EMPTY_BRACES/@EntryValue">False</s:Boolean>
2526
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
2627
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
2728
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CLSID/@EntryIndexedValue">CLSID</s:String>

ClearScript.sln

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27004.2006
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClearScript", "ClearScript\ClearScript.csproj", "{D2382D2C-6576-4D96-B6CD-057C4F6BED96}"
77
EndProject
@@ -39,7 +39,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3939
ClearScript\doc\Build.docx = ClearScript\doc\Build.docx
4040
ClearScript\doc\Examples.docx = ClearScript\doc\Examples.docx
4141
ClearScript\doc\FAQtorial.docx = ClearScript\doc\FAQtorial.docx
42-
ClearScript\doc\FAQtorial.pdf = ClearScript\doc\FAQtorial.pdf
4342
License.txt = License.txt
4443
ReadMe.md = ReadMe.md
4544
ClearScript\doc\Reference.chm = ClearScript\doc\Reference.chm
@@ -90,4 +89,7 @@ Global
9089
{2D63EA35-BA9C-4E77-B5A4-4938DBBFEFA6} = {14370560-F9FD-486D-A88E-D22C02576442}
9190
{CDCF4EEA-1CA4-412E-8C77-78893A67A577} = {14370560-F9FD-486D-A88E-D22C02576442}
9291
EndGlobalSection
92+
GlobalSection(ExtensibilityGlobals) = postSolution
93+
SolutionGuid = {3BAF1393-35E4-45F1-AC56-4A22646B56E5}
94+
EndGlobalSection
9395
EndGlobal

ClearScript.sln.DotSettings

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String>
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp50</s:String>
33
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ecpp/@EntryIndexedValue">True</s:Boolean>
44
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Eh/@EntryIndexedValue">True</s:Boolean>
55
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue">DO_NOT_SHOW</s:String>
@@ -22,6 +22,7 @@
2222
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
2323
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>
2424
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_TYPEOF_PARENTHESES/@EntryValue">False</s:Boolean>
25+
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHING_EMPTY_BRACES/@EntryValue">False</s:Boolean>
2526
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
2627
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
2728
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CLSID/@EntryIndexedValue">CLSID</s:String>

ClearScript/ClearScript.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3333
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3434
<Prefer32Bit>false</Prefer32Bit>
35+
<LangVersion>5</LangVersion>
3536
</PropertyGroup>
3637
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
3738
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -46,6 +47,7 @@
4647
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4748
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4849
<Prefer32Bit>false</Prefer32Bit>
50+
<LangVersion>5</LangVersion>
4951
</PropertyGroup>
5052
<PropertyGroup Condition="Exists('$(SolutionDir)ClearScript.snk')">
5153
<SignAssembly>true</SignAssembly>
@@ -56,6 +58,7 @@
5658
<Reference Include="System" />
5759
<Reference Include="System.Core" />
5860
<Reference Include="Microsoft.CSharp" />
61+
<Reference Include="System.Web" />
5962
<Reference Include="WindowsBase" />
6063
</ItemGroup>
6164
<ItemGroup>
@@ -90,10 +93,11 @@
9093
<Compile Include="ScriptObject.cs" />
9194
<Compile Include="ScriptUsageAttribute.cs" />
9295
<Compile Include="Util\AssemblyHelpers.cs" />
96+
<Compile Include="Util\BitwiseHelpers.cs" />
9397
<Compile Include="Util\Collateral.cs" />
9498
<Compile Include="Util\COMDispatchHelpers.cs" />
9599
<Compile Include="Util\CoTaskMemBlock.cs" />
96-
<Compile Include="Util\DisposedFlag.cs" />
100+
<Compile Include="Util\OneWayFlag.cs" />
97101
<Compile Include="HostList.cs" />
98102
<Compile Include="Util\INativeCallback.cs" />
99103
<Compile Include="Util\IHostInvokeContext.cs" />
@@ -107,9 +111,12 @@
107111
<Compile Include="Util\Scope.cs" />
108112
<Compile Include="Util\SocketHelpers.cs" />
109113
<Compile Include="Util\SpecialDispIDs.cs" />
114+
<Compile Include="Util\Web\WebContext.cs" />
115+
<Compile Include="Util\Web\WebRequest.cs" />
116+
<Compile Include="Util\Web\WebResponse.cs" />
110117
<Compile Include="Util\UnmanagedMemoryHelpers.cs" />
111118
<Compile Include="Util\VTablePatcher.cs" />
112-
<Compile Include="Util\WebSocketHelpers.cs" />
119+
<Compile Include="Util\Web\WebSocket.cs" />
113120
<Compile Include="V8\IV8DebugListener.cs" />
114121
<Compile Include="V8\V8ArrayBufferOrViewInfo.cs" />
115122
<Compile Include="V8\V8ArrayBufferOrViewKind.cs" />

ClearScript/Exports/VersionSymbols.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
#pragma once
77

8-
#define CLEARSCRIPT_VERSION_STRING "5.5.0.0"
9-
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 5,5,0,0
8+
#define CLEARSCRIPT_VERSION_STRING "5.5.1.0"
9+
#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 5,5,1,0

ClearScript/ExtensionMethods.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ internal class ExtensionMethodSummary
5050
{
5151
public ExtensionMethodSummary()
5252
{
53-
Types = MiscHelpers.GetEmptyArray<Type>();
54-
Methods = MiscHelpers.GetEmptyArray<MethodInfo>();
55-
MethodNames = MiscHelpers.GetEmptyArray<string>();
53+
Types = ArrayHelpers.GetEmptyArray<Type>();
54+
Methods = ArrayHelpers.GetEmptyArray<MethodInfo>();
55+
MethodNames = ArrayHelpers.GetEmptyArray<string>();
5656
}
5757

5858
public ExtensionMethodSummary(Dictionary<Type, MethodInfo[]> table)

ClearScript/HostItem.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public object InvokeMember(string name, BindingFlags invokeFlags, object[] args,
187187
if ((args.Length > testLength) && (name != SpecialMemberNames.Default))
188188
{
189189
bool valueIsCacheable;
190-
var value = GetHostProperty(name, GetCommonBindFlags(), MiscHelpers.GetEmptyArray<object>(), MiscHelpers.GetEmptyArray<object>(), culture, false, out valueIsCacheable);
190+
var value = GetHostProperty(name, GetCommonBindFlags(), ArrayHelpers.GetEmptyArray<object>(), ArrayHelpers.GetEmptyArray<object>(), culture, false, out valueIsCacheable);
191191
if (!(value is Nonexistent))
192192
{
193193
var hostItem = engine.MarshalToScript(value) as HostItem;
@@ -333,7 +333,7 @@ private string[] OwnMethodNames
333333

334334
private string[] EnumeratedMethodNames
335335
{
336-
get { return engine.EnumerateInstanceMethods ? (engine.EnumerateExtensionMethods ? AllMethodNames : OwnMethodNames) : MiscHelpers.GetEmptyArray<string>(); }
336+
get { return engine.EnumerateInstanceMethods ? (engine.EnumerateExtensionMethods ? AllMethodNames : OwnMethodNames) : ArrayHelpers.GetEmptyArray<string>(); }
337337
}
338338

339339
private string[] AllPropertyNames
@@ -647,7 +647,7 @@ private string[] GetAllFieldNames()
647647
return GetLocalFieldNames().Concat(GetLocalEventNames()).Distinct().ToArray();
648648
}
649649

650-
return MiscHelpers.GetEmptyArray<string>();
650+
return ArrayHelpers.GetEmptyArray<string>();
651651
}
652652

653653
private string[] GetAllMethodNames(out string[] ownMethodNames)
@@ -1622,7 +1622,7 @@ public override bool TryCreateInstance(CreateInstanceBinder binder, object[] arg
16221622

16231623
public override bool TryGetMember(GetMemberBinder binder, out object result)
16241624
{
1625-
result = ThisDynamic.GetProperty(binder.Name, MiscHelpers.GetEmptyArray<object>()).ToDynamicResult(engine);
1625+
result = ThisDynamic.GetProperty(binder.Name, ArrayHelpers.GetEmptyArray<object>()).ToDynamicResult(engine);
16261626
return true;
16271627
}
16281628

@@ -1643,7 +1643,7 @@ public override bool TryGetIndex(GetIndexBinder binder, object[] indices, out ob
16431643
return true;
16441644
}
16451645

1646-
result = ThisDynamic.GetProperty(indices[0].ToString(), MiscHelpers.GetEmptyArray<object>()).ToDynamicResult(engine);
1646+
result = ThisDynamic.GetProperty(indices[0].ToString(), ArrayHelpers.GetEmptyArray<object>()).ToDynamicResult(engine);
16471647
return true;
16481648
}
16491649

@@ -1925,7 +1925,7 @@ string[] IDynamic.GetPropertyNames()
19251925

19261926
object IDynamic.GetProperty(int index)
19271927
{
1928-
return ThisDynamic.GetProperty(index.ToString(CultureInfo.InvariantCulture), MiscHelpers.GetEmptyArray<object>());
1928+
return ThisDynamic.GetProperty(index.ToString(CultureInfo.InvariantCulture), ArrayHelpers.GetEmptyArray<object>());
19291929
}
19301930

19311931
void IDynamic.SetProperty(int index, object value)
@@ -2007,7 +2007,7 @@ int IEnumVARIANT.Next(int count, object[] elements, IntPtr pCountFetched)
20072007
var maxCount = Math.Min(count, elements.Length);
20082008
while ((index < maxCount) && TargetEnumerator.MoveNext())
20092009
{
2010-
elements[index++] = ThisDynamic.GetProperty("Current", MiscHelpers.GetEmptyArray<object>());
2010+
elements[index++] = ThisDynamic.GetProperty("Current", ArrayHelpers.GetEmptyArray<object>());
20112011
}
20122012
}
20132013

ClearScript/HostObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static object WrapResult(object result, Type type, bool wrapNull)
7070

7171
private static HostObject GetNullWrapper(Type type)
7272
{
73-
return (HostObject)getNullWrapperGenericMethod.MakeGenericMethod(type).Invoke(null, MiscHelpers.GetEmptyArray<object>());
73+
return (HostObject)getNullWrapperGenericMethod.MakeGenericMethod(type).Invoke(null, ArrayHelpers.GetEmptyArray<object>());
7474
}
7575

7676
// ReSharper disable UnusedMember.Local

ClearScript/HostTarget.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ internal abstract class HostTarget
2121

2222
public virtual string[] GetAuxMethodNames(IHostInvokeContext context, BindingFlags bindFlags)
2323
{
24-
return MiscHelpers.GetEmptyArray<string>();
24+
return ArrayHelpers.GetEmptyArray<string>();
2525
}
2626

2727
public virtual string[] GetAuxPropertyNames(IHostInvokeContext context, BindingFlags bindFlags)
2828
{
29-
return MiscHelpers.GetEmptyArray<string>();
29+
return ArrayHelpers.GetEmptyArray<string>();
3030
}
3131

3232
public virtual bool TryInvokeAuxMember(IHostInvokeContext context, string name, BindingFlags invokeFlags, object[] args, object[] bindArgs, out object result)

ClearScript/HostType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public override string[] GetAuxPropertyNames(IHostInvokeContext context, Binding
173173
return type.GetScriptableNestedTypes(bindFlags, context.DefaultAccess).Select(testType => testType.GetRootName()).Distinct().ToArray();
174174
}
175175

176-
return MiscHelpers.GetEmptyArray<string>();
176+
return ArrayHelpers.GetEmptyArray<string>();
177177
}
178178

179179
public override bool TryInvokeAuxMember(IHostInvokeContext context, string name, BindingFlags invokeFlags, object[] args, object[] bindArgs, out object result)

0 commit comments

Comments
 (0)