aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/core/promise.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/core/promise.js')
-rwxr-xr-xnode_modules/montage/core/promise.js42
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
677var rejections = []; 678var rejections = [];
678var errors = []; 679var errors = [];
679// Live console objects are not handled on tablets 680var errorsDisplayed = false;
680if (typeof window !== "undefined" && !window.Touch) { 681var 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
696exports.Promise = Promise; 706exports.Promise = Promise;
697 707