On Saturday, 6 July 2013 at 00:21:54 UTC, Adam D. Ruppe wrote:
// the second () is just because @property is broken
writeln(Math.max()("12", 24)); // prints 24
With dynamic typing there's no way to tell if Math.max(12,24) is
a method call or field delegate call. Javascript assumes it's
member call and passes this pointer to the called function. When
I implemented an object for javascript, I chose to detect if a
called method is a field with delegate and forward the call to
the delegate as per semantics of javascript.