Skip to content

Commit ff7d454

Browse files
ClearScript 5.4: Added COM object projection (Issue #38); host methods, events, and const/readonly fields are now cached as direct V8 object properties; made V8ScriptEngine.CollectGarbage() much more aggressive; added WindowsScriptEngineFlags.MarshalArraysByValue; added ScriptEngine.UseReflectionBindFallback; VBScript's "For Each ... Next" and JScript's "Enumerator" now operate on IEnumerable instances; added optional heap size monitoring to V8ScriptEngine and V8Runtime (experimental); added HostFunctions.tryCatch(); added ScriptEngine.Invoke() and V8ScriptEngine.Execute(V8Script); V8Update now supports branched V8 revisions; fixed exception when using WindowsScriptEngineFlags.EnableDebugging with no suitable script debugger installed (Issue #36); updates for breaking V8 API changes; added tests for bug fixes and new APIs. Tested with V8 3.26.31.15.
1 parent e9b6e92 commit ff7d454

88 files changed

Lines changed: 5286 additions & 530 deletions

File tree

Some content is hidden

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

ClearScript.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReturnTypeCanBeEnumerable_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
99
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringEndsWithIsCultureSpecific/@EntryIndexedValue">WARNING</s:String>
1010
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringStartsWithIsCultureSpecific/@EntryIndexedValue">WARNING</s:String>
11+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseObjectOrCollectionInitializer/@EntryIndexedValue">HINT</s:String>
1112
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VBStringEndsWithIsCultureSpecific/@EntryIndexedValue">WARNING</s:String>
1213
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VBStringStartsWithIsCultureSpecific/@EntryIndexedValue">WARNING</s:String>
1314
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">NEXT_LINE</s:String>

ClearScript/BindSignature.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,26 @@
6060
//
6161

6262
using System;
63+
using System.Reflection;
6364

6465
namespace Microsoft.ClearScript
6566
{
6667
internal class BindSignature : IEquatable<BindSignature>
6768
{
6869
private readonly Type context;
70+
private readonly BindingFlags flags;
6971
private readonly TargetInfo targetInfo;
7072
private readonly string name;
7173
private readonly Type[] typeArgs;
7274
private readonly ArgInfo[] argData;
7375

74-
public BindSignature(Type context, HostTarget target, string name, Type[] typeArgs, object[] args)
76+
public BindSignature(Type context, BindingFlags flags, HostTarget target, string name, Type[] typeArgs, object[] args)
7577
{
7678
this.context = context;
79+
this.flags = flags;
7780
targetInfo = new TargetInfo(target);
78-
this.typeArgs = typeArgs;
7981
this.name = name;
82+
this.typeArgs = typeArgs;
8083

8184
argData = new ArgInfo[args.Length];
8285
for (var index = 0; index < args.Length; index++)
@@ -97,6 +100,7 @@ public override int GetHashCode()
97100
var accumulator = new HashAccumulator();
98101

99102
accumulator.Update(context);
103+
accumulator.Update((int)flags);
100104
targetInfo.UpdateHash(ref accumulator);
101105
accumulator.Update(name);
102106

@@ -129,6 +133,11 @@ public bool Equals(BindSignature that)
129133
return false;
130134
}
131135

136+
if (flags != that.flags)
137+
{
138+
return false;
139+
}
140+
132141
if (!targetInfo.Equals(that.targetInfo))
133142
{
134143
return false;

ClearScript/ClearScript.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<Compile Include="Util\COMDispatch.cs" />
8686
<Compile Include="Util\IScriptMarshalWrapper.cs" />
8787
<Compile Include="Util\MemberHelpers.cs" />
88+
<Compile Include="Util\MemberMap.cs" />
8889
<Compile Include="Util\SpecialDispIDs.cs" />
8990
<Compile Include="V8\V8RuntimeHeapInfo.cs" />
9091
<Compile Include="V8\V8Script.cs" />
@@ -120,7 +121,6 @@
120121
<Compile Include="HostFunctions.cs" />
121122
<Compile Include="HostEvent.cs" />
122123
<Compile Include="HostItem.InvokeMethod.cs" />
123-
<Compile Include="HostItem.Members.cs" />
124124
<Compile Include="HostObject.cs" />
125125
<Compile Include="HostTarget.cs" />
126126
<Compile Include="Windows\ActiveXDebugging.cs" />

0 commit comments

Comments
 (0)