From b334ce7735ae453bd5643b251f36c3cedce4b3de Mon Sep 17 00:00:00 2001 From: Timmy Willison <4timmywil@gmail.com> Date: Mon, 12 Aug 2019 12:06:52 -0400 Subject: [PATCH] Tests: update npo.js and include unminified source instead Close gh-4446 Ref gh-4445 --- Gruntfile.js | 2 +- external/npo/npo.js | 370 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 370 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 0bd84960d..6f9643f46 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -74,7 +74,7 @@ module.exports = function( grunt ) { destPrefix: "external" }, files: { - "npo/npo.js": "native-promise-only/npo.js", + "npo/npo.js": "native-promise-only/lib/npo.src.js", "qunit/qunit.js": "qunit/qunit/qunit.js", "qunit/qunit.css": "qunit/qunit/qunit.css", diff --git a/external/npo/npo.js b/external/npo/npo.js index c363ed4c2..50e24ae6c 100644 --- a/external/npo/npo.js +++ b/external/npo/npo.js @@ -2,4 +2,372 @@ v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org */ -!function(t,n,e){n[t]=n[t]||e(),"undefined"!=typeof module&&module.exports?module.exports=n[t]:"function"==typeof define&&define.amd&&define(function(){return n[t]})}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||"object"!=e&&"function"!=e||(n=t.then),"function"==typeof n?n:!1}function e(){for(var t=0;t0&&t(e,u))}catch(a){i.call(new f(u),a)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r 0) { + schedule(notify,self); + } + } + } + catch (err) { + reject.call(new MakeDefWrapper(self),err); + } + } + + function reject(msg) { + var self = this; + + // already triggered? + if (self.triggered) { return; } + + self.triggered = true; + + // unwrap + if (self.def) { + self = self.def; + } + + self.msg = msg; + self.state = 2; + if (self.chain.length > 0) { + schedule(notify,self); + } + } + + function iteratePromises(Constructor,arr,resolver,rejecter) { + for (var idx=0; idx