I managed to fix it by creating this:

1
2
[<JavaScript; Inline "$x.field()">]
let field x = X<unit>

I expected this to be the default translation, anyone has any idea why?

By on 7/21/2015 9:39 PM ()

The issue is that the semantics of the ? operator is "access a value field", not "access a method". So the subsequent function call (passing ()) is basically treated as calling an anonymous function. And when calling an anonymous function, the value of this inside the function should be null, not obj. This is why it's translated as .call(null, ...).

As a side note, when you use [<Inline "...">], you do not need to add [<JavaScript>] as well.

By on 7/22/2015 12:53 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