It seems that methods are not compiled to method calls in the javascript
backend. I am sure there are very good reasons of incompatible semantics here.
Yet there are js APIs that require being able to pass objects with methods to
library functions. How would one generate the equivalent of this js object?
var obj = {
name: "Andrea",
surname: "Ferretti",
fullname: function() { return this.name + " " + this.surname; },
greet: function() { console.log(fullname); }
};
obj.greet();
In general methods can be passed as closure members, but these do not have
access to `this`