class Foo { foo = function() { return this; } test(other) { this.foo(); other.obj.foo(); } }