Socket
Socket
Sign inDemoInstall

bluebird

Package Overview
Dependencies
Maintainers
1
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluebird - npm Package Compare versions

Comparing version 0.9.11-0 to 0.9.11-1

sauce_connect.log

50

API.md

@@ -1405,2 +1405,27 @@ #API Reference

**Tip**
If you yield an array then its elements are implicitly waited for.
You can combine it with ES6 destructing for some neat syntax:
```js
var getData = Promise.coroutine(function* (urlA, urlB) {
[resultA, resultB] = yield [http.getAsync(urlA), http.getAsync(urlB)];
//use resultA
//use resultB
});
```
You might wonder why not just do this?
```js
var getData = Promise.coroutine(function* (urlA, urlB) {
var resultA = yield http.getAsync(urlA);
var resultB = yield http.getAsync(urlB);
});
```
The problem with the above is that the requests are not done in parallel. It will completely wait for request A to complete before even starting request B. In the array syntax both requests fire off at the same time in parallel.
<hr>

@@ -1454,2 +1479,27 @@

**Tip**
If you yield an array then its elements are implicitly waited for.
You can combine it with ES6 destructing for some neat syntax:
```js
var getData = Promise.coroutine(function* (urlA, urlB) {
[resultA, resultB] = yield [http.getAsync(urlA), http.getAsync(urlB)];
//use resultA
//use resultB
});
```
You might wonder why not just do this?
```js
var getData = Promise.coroutine(function* (urlA, urlB) {
var resultA = yield http.getAsync(urlA);
var resultB = yield http.getAsync(urlB);
});
```
The problem with the above is that the requests are not done in parallel. It will completely wait for request A to complete before even starting request B. In the array syntax both requests fire off at the same time in parallel.
<hr>

@@ -1456,0 +1506,0 @@

1

Gruntfile.js

@@ -15,2 +15,3 @@ "use strict";

var browsers = {
"internet explorer|Windows XP": ["7"],
"internet explorer|Windows 7": ["8", "9", "10"],

@@ -17,0 +18,0 @@ "internet explorer|Windows 8.1": ["11"],

16

js/main/promise_spawn.js

@@ -28,2 +28,3 @@ /**

var util = require("./util.js");
var isArray = util.isArray;
var errorObj = util.errorObj;

@@ -65,6 +66,11 @@ var tryCatch1 = util.tryCatch1;

if( !( maybePromise instanceof Promise ) ) {
this._throw( new TypeError(
"A value was yielded that could not be treated as a promise"
) );
return;
if( isArray( maybePromise ) ) {
maybePromise = Promise.all( maybePromise );
}
else {
this._throw( new TypeError(
"A value was yielded that could not be treated as a promise"
) );
return;
}
}

@@ -97,2 +103,2 @@ maybePromise._then(

return PromiseSpawn;
};
};

@@ -28,2 +28,3 @@ /**

var util = require("./util.js");
var isArray = util.isArray;
var errorObj = util.errorObj;

@@ -65,6 +66,11 @@ var tryCatch1 = util.tryCatch1;

if( !( maybePromise instanceof Promise ) ) {
this._throw( new TypeError(
"A value was yielded that could not be treated as a promise"
) );
return;
if( isArray( maybePromise ) ) {
maybePromise = Promise.all( maybePromise );
}
else {
this._throw( new TypeError(
"A value was yielded that could not be treated as a promise"
) );
return;
}
}

@@ -97,2 +103,2 @@ maybePromise._then(

return PromiseSpawn;
};
};
{
"name": "bluebird",
"description": "Full featured Promises/A+ implementation with exceptionally good performance",
"version": "0.9.11-0",
"version": "0.9.11-1",
"keywords": [

@@ -6,0 +6,0 @@ "promise",

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