Socket
Socket
Sign inDemoInstall

bluebird

Package Overview
Dependencies
0
Maintainers
1
Versions
223
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.9.33 to 2.9.34

7

changelog.md

@@ -0,1 +1,8 @@

## 2.9.34 (2015-07-15)
Bugfixes:
- Correct domain for .map, .each, .filter, .reduce callbacks ([#701](.)).
- Preserve bound-with-promise promises across the entire chain ([#702](.)).
## 2.9.33 (2015-07-09)

@@ -2,0 +9,0 @@

9

js/main/bind.js

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

var bindingResolved = function(thisArg, context) {
this._setBoundTo(thisArg);
if (this._isPending()) {

@@ -29,2 +28,4 @@ this._resolveCallback(context.target);

var target = this._target();
ret._setBoundTo(maybePromise);
if (maybePromise instanceof Promise) {

@@ -41,3 +42,2 @@ var context = {

} else {
ret._setBoundTo(thisArg);
ret._resolveCallback(target);

@@ -65,9 +65,8 @@ }

ret._setBoundTo(maybePromise);
if (maybePromise instanceof Promise) {
maybePromise._then(function(thisArg) {
ret._setBoundTo(thisArg);
maybePromise._then(function() {
ret._resolveCallback(value);
}, ret._reject, ret._progress, ret, null);
} else {
ret._setBoundTo(thisArg);
ret._resolveCallback(value);

@@ -74,0 +73,0 @@ }

@@ -33,3 +33,3 @@ "use strict";

var promise = this._promise;
var boundTo = promise._boundTo;
var boundTo = promise._boundValue();
for (var i = 0, len = this._instances.length; i < len; ++i) {

@@ -36,0 +36,0 @@ var item = this._instances[i];

@@ -38,3 +38,3 @@ "use strict";

var ret = promise._isBound()
? handler.call(promise._boundTo)
? handler.call(promise._boundValue())
: handler();

@@ -64,3 +64,3 @@

var ret = promise._isBound()
? handler.call(promise._boundTo, value)
? handler.call(promise._boundValue(), value)
: handler(value);

@@ -67,0 +67,0 @@

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

INTERNAL) {
var getDomain = Promise._getDomain;
var async = require("./async.js");

@@ -18,3 +19,4 @@ var util = require("./util.js");

this._promise._captureStackTrace();
this._callback = fn;
var domain = getDomain();
this._callback = domain === null ? fn : domain.bind(fn);
this._preservedValues = _filter === INTERNAL

@@ -54,3 +56,3 @@ ? new Array(this.length())

var callback = this._callback;
var receiver = this._promise._boundTo;
var receiver = this._promise._boundValue();
this._promise._pushContext();

@@ -57,0 +59,0 @@ var ret = tryCatch(callback).call(receiver, value, index, length);

@@ -11,3 +11,4 @@ "use strict";

if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);
var ret = tryCatch(nodeback).apply(promise._boundTo, [null].concat(val));
var ret =
tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));
if (ret === errorObj) {

@@ -20,3 +21,3 @@ async.throwLater(ret.e);

var promise = this;
var receiver = promise._boundTo;
var receiver = promise._boundValue();
var ret = val === undefined

@@ -37,3 +38,3 @@ ? tryCatch(nodeback).call(receiver, null)

}
var ret = tryCatch(nodeback).call(promise._boundTo, reason);
var ret = tryCatch(nodeback).call(promise._boundValue(), reason);
if (ret === errorObj) {

@@ -44,3 +45,3 @@ async.throwLater(ret.e);

Promise.prototype.asCallback =
Promise.prototype.asCallback =
Promise.prototype.nodeify = function (nodeback, options) {

@@ -47,0 +48,0 @@ if (typeof nodeback == "function") {

@@ -314,3 +314,3 @@ "use strict";

if (ret === undefined && this._isBound()) {
return this._boundTo;
return this._boundValue();
}

@@ -338,2 +338,16 @@ return ret;

Promise.prototype._boundValue = function() {
var ret = this._boundTo;
if (ret !== undefined) {
if (ret instanceof Promise) {
if (ret.isFulfilled()) {
return ret.value();
} else {
return undefined;
}
}
}
return ret;
};
Promise.prototype._migrateCallbacks = function (follower, index) {

@@ -489,3 +503,3 @@ var fulfill = follower._fulfillmentHandlerAt(index);

if (receiver === APPLY && !this._isRejected()) {
x = tryCatch(handler).apply(this._boundTo, value);
x = tryCatch(handler).apply(this._boundValue(), value);
} else {

@@ -560,4 +574,2 @@ x = tryCatch(handler).call(receiver, value);

var receiver = this._receiverAt(index);
this._clearCallbackDataAtIndex(index);

@@ -564,0 +576,0 @@

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

INTERNAL) {
var getDomain = Promise._getDomain;
var async = require("./async.js");

@@ -36,3 +37,4 @@ var util = require("./util.js");

if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true;
this._callback = fn;
var domain = getDomain();
this._callback = domain === null ? fn : domain.bind(fn);
this._accum = accum;

@@ -91,3 +93,3 @@ if (!rejected) async.invoke(init, this, undefined);

var callback = this._callback;
var receiver = this._promise._boundTo;
var receiver = this._promise._boundValue();
var ret;

@@ -94,0 +96,0 @@

{
"name": "bluebird",
"description": "Full featured Promises/A+ implementation with exceptionally good performance",
"version": "2.9.33",
"version": "2.9.34",
"keywords": [

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc