Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

promise.allsettled

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise.allsettled - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

CHANGELOG.md

@@ -0,3 +1,7 @@

v1.0.1 / 2019-05-06
=================
* [Fix] when a promise has a poisoned `.then` method, reject the overarching promise (#1)
v1.0.0 / 2019-03-27
=================
* Initial release.

@@ -12,2 +12,3 @@ 'use strict';

var all = bind.call(Function.call, getIntrinsic('%Promise_all%'));
var reject = bind.call(Function.call, getIntrinsic('%Promise_reject%'));

@@ -27,4 +28,8 @@ module.exports = function allSettled(iterable) {

var itemPromise = ES.PromiseResolve(C, item);
return itemPromise.then(onFulfill, onReject);
try {
return itemPromise.then(onFulfill, onReject);
} catch (e) {
return reject(C, e);
}
}));
};

4

package.json
{
"name": "promise.allsettled",
"version": "1.0.0",
"version": "1.0.1",
"author": "Jordan Harband",

@@ -63,3 +63,3 @@ "contributors": [

"es6-shim": "^0.35.5",
"eslint": "^5.15.3",
"eslint": "^5.16.0",
"safe-publish-latest": "^1.1.2",

@@ -66,0 +66,0 @@ "tape": "^4.10.1"

@@ -84,2 +84,13 @@ 'use strict';

t.test('poisoned .then', function (st) {
st.plan(1);
var promise = new Promise(function () {});
promise.then = function () { throw new EvalError(); };
allSettled([promise]).then(function () {
st.fail('should not reach here');
}, function (reason) {
st.equal(reason instanceof EvalError, true, 'expected error was thrown');
});
});
var Subclass = (function () {

@@ -86,0 +97,0 @@ try {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc