diff options
author | Jose Antonio Marquez | 2012-06-20 16:47:37 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-06-20 16:47:37 -0700 |
commit | 313a62245400e6c8cfa6d2f02c603cc7f01ddfc6 (patch) | |
tree | c207d1290be0e894a57b03098bbb7bbe5f2aee86 /node_modules/montage/core/promise.js | |
parent | 2496e0d0b0ac5f8c53b12de77f0feda69ce4a2f4 (diff) | |
parent | 392a559e90357d48c910a07617261483b2b45476 (diff) | |
download | ninja-313a62245400e6c8cfa6d2f02c603cc7f01ddfc6.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into Document
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 | ||