For some reason, objects that have been returned from the server end of a Google Apps Script project have any member functions replaced by null
. Here's some sample code demonstrating this:
server.gs
function A() {
this.a = 'a string';
this.toString = function() { return this.a; }
this.innerObj = { b : "B", toString : function(){ return 'inner object'; } }
}
function getA() { return new A(); }
clientJS.html; /* or console, if you prefer... */
google.script.run.withSuccessHandler(console.log).getA();
Object, when printed raw, looks something like this:
{ "a": "a string", "toString": null, "innerObj": { "b": "B", "toString": null } }
what can I do about this?!