Right, this looks like a bug indeed. We should check if the value is a JavaScript object before testing its members.

Meanwhile you can work around it with something like this:

1
2
3
4
    let AsFoo m = 
        match JS.TypeOf m, box m with
        | JS.Object, :? IFoo as f -> Some f
        | _ -> None
By on 5/7/2018 6:13 AM ()

I just submitted this as issue #944.

By on 5/7/2018 6:16 AM ()

Hi, the fix have been released in WebSharper 4.2.11

By on 5/17/2018 8:17 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper