diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-04-05 22:51:49 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-04-05 23:00:02 +0200 |
commit | e37effe4cec98688e75d770f4d0b7f68927e2b73 (patch) | |
tree | e7efa0fc8a2139f9aba4b66ea3f3613262f20cef /deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/es6-promisify/node_modules/es6-promise/lib/es6-promise/-internal.js | |
parent | 026f6b787a7a23597790f1f0b076c58a68c7c38b (diff) | |
download | android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.tar.gz android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.tar.bz2 android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.zip |
Revert "deps: upgrade npm to 5.8.0"
This reverts commit 25a816dcda7b1db0929501acfe13f2fe5119759b.
PR-URL: https://github.com/nodejs/node/pull/19837
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/es6-promisify/node_modules/es6-promise/lib/es6-promise/-internal.js')
1 files changed, 12 insertions, 7 deletions
diff --git a/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/es6-promisify/node_modules/es6-promise/lib/es6-promise/-internal.js b/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/es6-promisify/node_modules/es6-promise/lib/es6-promise/-internal.js index 925776f55f..038140d8d8 100644 --- a/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/es6-promisify/node_modules/es6-promise/lib/es6-promise/-internal.js +++ b/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/es6-promisify/node_modules/es6-promise/lib/es6-promise/-internal.js @@ -10,7 +10,7 @@ import { import originalThen from './then'; import originalResolve from './promise/resolve'; -export const PROMISE_ID = Math.random().toString(36).substring(2); +export const PROMISE_ID = Math.random().toString(36).substring(16); function noop() {} @@ -18,7 +18,7 @@ const PENDING = void 0; const FULFILLED = 1; const REJECTED = 2; -const TRY_CATCH_ERROR = { error: null }; +const GET_THEN_ERROR = new ErrorObject(); function selfFulfillment() { return new TypeError("You cannot resolve a promise with itself"); @@ -32,8 +32,8 @@ function getThen(promise) { try { return promise.then; } catch(error) { - TRY_CATCH_ERROR.error = error; - return TRY_CATCH_ERROR; + GET_THEN_ERROR.error = error; + return GET_THEN_ERROR; } } @@ -87,9 +87,9 @@ function handleMaybeThenable(promise, maybeThenable, then) { maybeThenable.constructor.resolve === originalResolve) { handleOwnThenable(promise, maybeThenable); } else { - if (then === TRY_CATCH_ERROR) { - reject(promise, TRY_CATCH_ERROR.error); - TRY_CATCH_ERROR.error = null; + if (then === GET_THEN_ERROR) { + reject(promise, GET_THEN_ERROR.error); + GET_THEN_ERROR.error = null; } else if (then === undefined) { fulfill(promise, maybeThenable); } else if (isFunction(then)) { @@ -174,6 +174,11 @@ function publish(promise) { promise._subscribers.length = 0; } +function ErrorObject() { + this.error = null; +} + +const TRY_CATCH_ERROR = new ErrorObject(); function tryCatch(callback, detail) { try { |