mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
* first action! (#1)
This commit is contained in:
parent
8deacc95b1
commit
ace1e6a69a
3750 changed files with 1155519 additions and 0 deletions
55
node_modules/bluebird/js/release/method.js
generated
vendored
Normal file
55
node_modules/bluebird/js/release/method.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
"use strict";
|
||||
module.exports =
|
||||
function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {
|
||||
var util = require("./util");
|
||||
var tryCatch = util.tryCatch;
|
||||
|
||||
Promise.method = function (fn) {
|
||||
if (typeof fn !== "function") {
|
||||
throw new Promise.TypeError("expecting a function but got " + util.classString(fn));
|
||||
}
|
||||
return function () {
|
||||
var ret = new Promise(INTERNAL);
|
||||
ret._captureStackTrace();
|
||||
ret._pushContext();
|
||||
var value = tryCatch(fn).apply(this, arguments);
|
||||
var promiseCreated = ret._popContext();
|
||||
debug.checkForgottenReturns(
|
||||
value, promiseCreated, "Promise.method", ret);
|
||||
ret._resolveFromSyncValue(value);
|
||||
return ret;
|
||||
};
|
||||
};
|
||||
|
||||
Promise.attempt = Promise["try"] = function (fn) {
|
||||
if (typeof fn !== "function") {
|
||||
return apiRejection("expecting a function but got " + util.classString(fn));
|
||||
}
|
||||
var ret = new Promise(INTERNAL);
|
||||
ret._captureStackTrace();
|
||||
ret._pushContext();
|
||||
var value;
|
||||
if (arguments.length > 1) {
|
||||
debug.deprecated("calling Promise.try with more than 1 argument");
|
||||
var arg = arguments[1];
|
||||
var ctx = arguments[2];
|
||||
value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)
|
||||
: tryCatch(fn).call(ctx, arg);
|
||||
} else {
|
||||
value = tryCatch(fn)();
|
||||
}
|
||||
var promiseCreated = ret._popContext();
|
||||
debug.checkForgottenReturns(
|
||||
value, promiseCreated, "Promise.try", ret);
|
||||
ret._resolveFromSyncValue(value);
|
||||
return ret;
|
||||
};
|
||||
|
||||
Promise.prototype._resolveFromSyncValue = function (value) {
|
||||
if (value === util.errorObj) {
|
||||
this._rejectCallback(value.e, false);
|
||||
} else {
|
||||
this._resolveCallback(value, true);
|
||||
}
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue