From f9ba2198efcea9979876b22b26378f84f861160f Mon Sep 17 00:00:00 2001 From: commander Date: Sun, 8 Feb 2015 14:06:06 +0100 Subject: [PATCH 1/2] * put comments infront of not yet defined function * fix possiblity to have undefined function (postSerializedResult) --- src/please.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/please.js b/src/please.js index 2acab90..e4dfbf5 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,20 +627,19 @@ Response.prototype = { var self = this; - try { + 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 if (jq_array && jq_array.length && isNode(jq_array[0])) { 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) { From d4b8042df56f69d23b5aef7bb9385dd50836b641 Mon Sep 17 00:00:00 2001 From: commander Date: Sun, 8 Feb 2015 14:28:45 +0100 Subject: [PATCH 2/2] * put comments infront of not yet defined function * fix possiblity to have undefined function (postSerializedResult) --- src/please.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/please.js b/src/please.js index e4dfbf5..42872ff 100644 --- a/src/please.js +++ b/src/please.js @@ -633,7 +633,7 @@ Response.prototype = { // set this in next stack }; - try { + try { var jq_array = jq instanceof $ ? jq.toArray() : jq; // firefox happens to serialize Nodes somehow, check and throw if so if (jq_array && jq_array.length && isNode(jq_array[0])) {