From 229fd8ff5583bfd4d93c477e99de4390f39454be Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Mon, 2 Mar 2015 12:23:40 -0500 Subject: [PATCH] fix(zone.js): don't make function declaration in block scope It's breaks JSC =) Closes #53 Closes #54 --- zone.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/zone.js b/zone.js index b45ce9081..21fa8b63f 100644 --- a/zone.js +++ b/zone.js @@ -246,23 +246,23 @@ Zone.bindPromiseFn = (function() { return patchThenable(delegate.apply(this, arguments)); }; }; + } - function patchThenable(thenable) { - var then = thenable.then; - thenable.then = function () { - var args = Zone.bindArguments(arguments); - var nextThenable = then.apply(thenable, args); - return patchThenable(nextThenable); - }; + function patchThenable(thenable) { + var then = thenable.then; + thenable.then = function () { + var args = Zone.bindArguments(arguments); + var nextThenable = then.apply(thenable, args); + return patchThenable(nextThenable); + }; - var ocatch = thenable.catch; - thenable.catch = function () { - var args = Zone.bindArguments(arguments); - var nextThenable = ocatch.apply(thenable, args); - return patchThenable(nextThenable); - }; - return thenable; - } + var ocatch = thenable.catch; + thenable.catch = function () { + var args = Zone.bindArguments(arguments); + var nextThenable = ocatch.apply(thenable, args); + return patchThenable(nextThenable); + }; + return thenable; } }());