Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Brought dynamic features up to speed for CLR2 assembly.

  • Loading branch information...
commit 986f27d64c6ad2f61a44346c70d18b738586ccdf 1 parent f5f6e96
@otac0n otac0n authored
View
4 Src/IronJS.Runtime/IronJS.Runtime.CLR2.csproj
@@ -8,8 +8,8 @@
<ProjectGuid>{E186E25A-34FF-4BD9-BBBE-B0B15849A828}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>IronJS.Runtime.CLR2</RootNamespace>
- <AssemblyName>IronJS.Runtime.CLR2</AssemblyName>
+ <RootNamespace>IronJS.Runtime</RootNamespace>
+ <AssemblyName>IronJS.Runtime</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
View
25 Src/IronJS.Runtime/Objects/CommonObject.cs
@@ -2,11 +2,16 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+#if !CLR2
using System.Dynamic;
+#endif
namespace IronJS.Runtime
{
- public class CommonObject : DynamicObject
+ public class CommonObject
+#if !CLR2
+ : DynamicObject
+#endif
{
public Environment Env;
public CommonObject Prototype;
@@ -38,6 +43,7 @@ internal CommonObject(Environment env)
this.Properties = null;
}
+#if !CLR2
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
var prop = this.Get(binder.Name);
@@ -93,6 +99,15 @@ public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, o
return false;
}
+ public override IEnumerable<string> GetDynamicMemberNames()
+ {
+ foreach (var kvp in this.PropertySchema.IndexMap)
+ {
+ yield return kvp.Key;
+ }
+ }
+#endif
+
public override string ToString()
{
var item = this.Find("toString");
@@ -131,14 +146,6 @@ public override string ToString()
}
}
- public override IEnumerable<string> GetDynamicMemberNames()
- {
- foreach (var kvp in this.PropertySchema.IndexMap)
- {
- yield return kvp.Key;
- }
- }
-
public bool HasPrototype
{
get { return this.Prototype != null; }
View
7 Src/IronJS.Runtime/Objects/FunctionObject.cs
@@ -3,6 +3,9 @@
using System.Linq;
using System.Text;
using Microsoft.FSharp.Collections;
+#if !CLR2
+using System.Dynamic;
+#endif
namespace IronJS.Runtime
{
@@ -55,12 +58,14 @@ public string Name
}
}
- public override bool TryInvoke(System.Dynamic.InvokeBinder binder, object[] args, out object result)
+#if !CLR2
+ public override bool TryInvoke(InvokeBinder binder, object[] args, out object result)
{
var boxedArgs = args.Select(x => BoxedValue.Box(x)).ToArray();
result = Call(Env.Globals, args).UnboxObject();
return true;
}
+#endif
public CommonObject InstancePrototype
{
Please sign in to comment.
Something went wrong with that request. Please try again.