mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 18:52:50 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
62
node_modules/bluebird/js/main/direct_resolve.js
generated
vendored
Normal file
62
node_modules/bluebird/js/main/direct_resolve.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var util = require("./util.js");
|
||||
var isPrimitive = util.isPrimitive;
|
||||
var wrapsPrimitiveReceiver = util.wrapsPrimitiveReceiver;
|
||||
|
||||
module.exports = function(Promise) {
|
||||
var returner = function () {
|
||||
return this;
|
||||
};
|
||||
var thrower = function () {
|
||||
throw this;
|
||||
};
|
||||
var returnUndefined = function() {};
|
||||
var throwUndefined = function() {
|
||||
throw undefined;
|
||||
};
|
||||
|
||||
var wrapper = function (value, action) {
|
||||
if (action === 1) {
|
||||
return function () {
|
||||
throw value;
|
||||
};
|
||||
} else if (action === 2) {
|
||||
return function () {
|
||||
return value;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Promise.prototype["return"] =
|
||||
Promise.prototype.thenReturn = function (value) {
|
||||
if (value === undefined) return this.then(returnUndefined);
|
||||
|
||||
if (wrapsPrimitiveReceiver && isPrimitive(value)) {
|
||||
return this._then(
|
||||
wrapper(value, 2),
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
}
|
||||
return this._then(returner, undefined, undefined, value, undefined);
|
||||
};
|
||||
|
||||
Promise.prototype["throw"] =
|
||||
Promise.prototype.thenThrow = function (reason) {
|
||||
if (reason === undefined) return this.then(throwUndefined);
|
||||
|
||||
if (wrapsPrimitiveReceiver && isPrimitive(reason)) {
|
||||
return this._then(
|
||||
wrapper(reason, 1),
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
}
|
||||
return this._then(thrower, undefined, undefined, reason, undefined);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user