diff options
author | Kruti Shah | 2012-06-20 15:12:48 -0700 |
---|---|---|
committer | Kruti Shah | 2012-06-20 15:12:48 -0700 |
commit | 1fe1202ba87d6de9b0f0d8efee78f955c5350210 (patch) | |
tree | 26ff4c6c5a94accfd5801f124244d3eef152a5c7 /node_modules/montage/core/promise.js | |
parent | 1ce4bd7033a413c7697888e5712f278219d6d095 (diff) | |
parent | 782b66c783df4a9c36fa240cc77900e69b9130cf (diff) | |
download | ninja-1fe1202ba87d6de9b0f0d8efee78f955c5350210.tar.gz |
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
Diffstat (limited to 'node_modules/montage/core/promise.js')
-rwxr-xr-x | node_modules/montage/core/promise.js | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/node_modules/montage/core/promise.js b/node_modules/montage/core/promise.js index 7563a742..6477131d 100755 --- a/node_modules/montage/core/promise.js +++ b/node_modules/montage/core/promise.js | |||
@@ -263,6 +263,7 @@ var PrimordialPromise = Creatable.create({ | |||
263 | self.Promise = this; | 263 | self.Promise = this; |
264 | rejections.push(self); | 264 | rejections.push(self); |
265 | errors.push(error ? (error.stack ? error.stack : error) : reason); | 265 | errors.push(error ? (error.stack ? error.stack : error) : reason); |
266 | displayErrors(); | ||
266 | return self; | 267 | return self; |
267 | } | 268 | } |
268 | }, | 269 | }, |
@@ -676,22 +677,31 @@ var Promise = PrimordialPromise.create({}, { // Descriptor for each of the three | |||
676 | 677 | ||
677 | var rejections = []; | 678 | var rejections = []; |
678 | var errors = []; | 679 | var errors = []; |
679 | // Live console objects are not handled on tablets | 680 | var errorsDisplayed = false; |
680 | if (typeof window !== "undefined" && !window.Touch) { | 681 | var displayErrors = function () { |
681 | 682 | // Live console objects are not handled on tablets or in Node | |
682 | /* | 683 | if ( |
683 | * This promise library consumes exceptions thrown in callbacks so | 684 | !errorsDisplayed && |
684 | * that they can be handled asynchronously. The exceptions get | 685 | typeof window !== "undefined" && |
685 | * added to ``errors`` when they are consumed, and removed when | 686 | !window.Touch && |
686 | * they are handled. In many debuggers, the view of the reported | 687 | typeof console === "object" |
687 | * array will update to reflect its current contents so you can | 688 | ) { |
688 | * always see if you have missed an error. | 689 | |
689 | * | 690 | /* |
690 | * This log will appear once for every time this module gets | 691 | * This promise library consumes exceptions thrown in callbacks so |
691 | * instantiated. That should be once per frame. | 692 | * that they can be handled asynchronously. The exceptions get |
692 | */ | 693 | * added to ``errors`` when they are consumed, and removed when |
693 | console.log("Should be empty:", errors); | 694 | * they are handled. In many debuggers, the view of the reported |
694 | } | 695 | * array will update to reflect its current contents so you can |
696 | * always see if you have missed an error. | ||
697 | * | ||
698 | * This log will appear once for every time this module gets | ||
699 | * instantiated. That should be once per frame. | ||
700 | */ | ||
701 | console.log("Should be empty:", errors); | ||
702 | errorsDisplayed = true; | ||
703 | } | ||
704 | }; | ||
695 | 705 | ||
696 | exports.Promise = Promise; | 706 | exports.Promise = Promise; |
697 | 707 | ||