Browse files

Merge branch 'interop-dynamic'

  • Loading branch information...
2 parents aa61a73 + 5f9243f commit 51d7ac75b6a93565c33d678575550a870350256f @otac0n otac0n committed Jul 4, 2011
Showing with 11 additions and 4 deletions.
  1. +11 −4 Src/IronJS/Runtime.fs
View
15 Src/IronJS/Runtime.fs
@@ -525,22 +525,29 @@ and [<AllowNullLiteral>] CommonObject =
}
override x.TryGetMember(binder:GetMemberBinder, result:obj byref) : bool =
- let item:Descriptor = x.Find(binder.Name)
- result <- if item.HasValue then item.Value.UnboxObject() else Undefined.Instance :> obj
+ let prop = x.Get(binder.Name)
+ result <- prop.UnboxObject()
true
override x.TryGetIndex(binder:GetIndexBinder, indexes:obj array, result:obj byref) : bool =
if indexes.Length <> 1 then
false
else
- let item:Descriptor = x.Find(string indexes.[0])
- result <- if item.HasValue then item.Value.UnboxObject() else Undefined.Instance :> obj
+ let prop = x.Get(string indexes.[0])
+ result <- prop.UnboxObject()
true
override x.TrySetMember(binder:SetMemberBinder, value:obj) : bool =
x.Put(binder.Name, value)
true
+ override x.TrySetIndex(binder:SetIndexBinder, indexes:obj array, value:obj) : bool =
+ if indexes.Length <> 1 then
+ false
+ else
+ x.Put(string indexes.[0], value)
+ true
+
override x.TryInvokeMember(binder:InvokeMemberBinder, args:obj array, result:obj byref) : bool =
let item:Descriptor = x.Find(binder.Name)
if item.HasValue then

0 comments on commit 51d7ac7

Please sign in to comment.