Skip to content
This repository
Browse code

Brought dynamic features up to speed for CLR2 assembly.

  • Loading branch information...
commit 986f27d64c6ad2f61a44346c70d18b738586ccdf 1 parent f5f6e96
John Gietzen authored July 09, 2011
4  Src/IronJS.Runtime/IronJS.Runtime.CLR2.csproj
@@ -8,8 +8,8 @@
8 8
     <ProjectGuid>{E186E25A-34FF-4BD9-BBBE-B0B15849A828}</ProjectGuid>
9 9
     <OutputType>Library</OutputType>
10 10
     <AppDesignerFolder>Properties</AppDesignerFolder>
11  
-    <RootNamespace>IronJS.Runtime.CLR2</RootNamespace>
12  
-    <AssemblyName>IronJS.Runtime.CLR2</AssemblyName>
  11
+    <RootNamespace>IronJS.Runtime</RootNamespace>
  12
+    <AssemblyName>IronJS.Runtime</AssemblyName>
13 13
     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14 14
     <FileAlignment>512</FileAlignment>
15 15
     <TargetFrameworkProfile />
25  Src/IronJS.Runtime/Objects/CommonObject.cs
@@ -2,11 +2,16 @@
2 2
 using System.Collections.Generic;
3 3
 using System.Linq;
4 4
 using System.Text;
  5
+#if !CLR2
5 6
 using System.Dynamic;
  7
+#endif
6 8
 
7 9
 namespace IronJS.Runtime
8 10
 {
9  
-    public class CommonObject : DynamicObject
  11
+    public class CommonObject
  12
+#if !CLR2
  13
+        : DynamicObject
  14
+#endif
10 15
     {
11 16
         public Environment Env;
12 17
         public CommonObject Prototype;
@@ -38,6 +43,7 @@ internal CommonObject(Environment env)
38 43
             this.Properties = null;
39 44
         }
40 45
 
  46
+#if !CLR2
41 47
         public override bool TryGetMember(GetMemberBinder binder, out object result)
42 48
         {
43 49
             var prop = this.Get(binder.Name);
@@ -93,6 +99,15 @@ public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, o
93 99
             return false;
94 100
         }
95 101
 
  102
+        public override IEnumerable<string> GetDynamicMemberNames()
  103
+        {
  104
+            foreach (var kvp in this.PropertySchema.IndexMap)
  105
+            {
  106
+                yield return kvp.Key;
  107
+            }
  108
+        }
  109
+#endif
  110
+
96 111
         public override string ToString()
97 112
         {
98 113
             var item = this.Find("toString");
@@ -131,14 +146,6 @@ public override string ToString()
131 146
             }
132 147
         }
133 148
 
134  
-        public override IEnumerable<string> GetDynamicMemberNames()
135  
-        {
136  
-            foreach (var kvp in this.PropertySchema.IndexMap)
137  
-            {
138  
-                yield return kvp.Key;
139  
-            }
140  
-        }
141  
-
142 149
         public bool HasPrototype
143 150
         {
144 151
             get { return this.Prototype != null; }
7  Src/IronJS.Runtime/Objects/FunctionObject.cs
@@ -3,6 +3,9 @@
3 3
 using System.Linq;
4 4
 using System.Text;
5 5
 using Microsoft.FSharp.Collections;
  6
+#if !CLR2
  7
+using System.Dynamic;
  8
+#endif
6 9
 
7 10
 namespace IronJS.Runtime
8 11
 {
@@ -55,12 +58,14 @@ public string Name
55 58
             }
56 59
         }
57 60
 
58  
-        public override bool TryInvoke(System.Dynamic.InvokeBinder binder, object[] args, out object result)
  61
+#if !CLR2
  62
+        public override bool TryInvoke(InvokeBinder binder, object[] args, out object result)
59 63
         {
60 64
             var boxedArgs = args.Select(x => BoxedValue.Box(x)).ToArray();
61 65
             result = Call(Env.Globals, args).UnboxObject();
62 66
             return true;
63 67
         }
  68
+#endif
64 69
 
65 70
         public CommonObject InstancePrototype
66 71
         {

0 notes on commit 986f27d

Please sign in to comment.
Something went wrong with that request. Please try again.