diff --git a/src/please.js b/src/please.js index 2acab90..42872ff 100644 --- a/src/please.js +++ b/src/please.js @@ -470,9 +470,10 @@ _please.$_fn = function (parentReq, funcName) { } } - if (typeof arg === 'object') { - mapObjectStringsToFunctions(arg); - } + //// this function is undefined todo?!? +// if (typeof arg === 'object') { +// mapObjectStringsToFunctions(arg); +// } return arg; }; for (var i = 0; i < args.length; i++) { @@ -626,6 +627,12 @@ Response.prototype = { var self = this; + var postSerializedResult = function() { + var serialized = JSON.stringify(self); + self.targetWindow.postMessage(serialized, self.targetOrigin); + // set this in next stack + }; + try { var jq_array = jq instanceof $ ? jq.toArray() : jq; // firefox happens to serialize Nodes somehow, check and throw if so @@ -633,13 +640,6 @@ Response.prototype = { throw ''; } - var postSerializedResult = function() { - var serialized = JSON.stringify(self); - self.targetWindow.postMessage(serialized, self.targetOrigin); - // set this in next stack - - }; - if (isPromise(this.data)) { this.data.then( function(resolved) {