@agoric/eventual-send
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -30,6 +30,7 @@ 'use strict'; | ||
if (typeof h[operation] !== 'function') { | ||
const handlerName = h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler'; | ||
const handlerName = | ||
h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler'; | ||
throw TypeError(`${handlerName}.${operation} is not a function`); | ||
} | ||
return h[operation](p, ...args); | ||
return Promise.resolve(h[operation](p, ...args)); | ||
} | ||
@@ -185,3 +186,2 @@ | ||
if (!presenceToHandler.has(presence)) { | ||
// Create table entries for the presence mapped to the fulfilledHandler. | ||
presenceToPromise.set(presence, handledP); | ||
@@ -191,4 +191,5 @@ presenceToHandler.set(presence, fulfilledHandler); | ||
// Remove the mapping, as our fulfilledHandler should be used instead. | ||
promiseToHandler.delete(handledP); | ||
// We need to invoke fulfilledHandler immediately, so add it | ||
// to the mapping. | ||
promiseToHandler.set(handledP, fulfilledHandler); | ||
@@ -195,0 +196,0 @@ // We committed to this presence, so resolve. |
@@ -28,6 +28,7 @@ /** | ||
if (typeof h[operation] !== 'function') { | ||
const handlerName = h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler'; | ||
const handlerName = | ||
h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler'; | ||
throw TypeError(`${handlerName}.${operation} is not a function`); | ||
} | ||
return h[operation](p, ...args); | ||
return Promise.resolve(h[operation](p, ...args)); | ||
} | ||
@@ -183,3 +184,2 @@ | ||
if (!presenceToHandler.has(presence)) { | ||
// Create table entries for the presence mapped to the fulfilledHandler. | ||
presenceToPromise.set(presence, handledP); | ||
@@ -189,4 +189,5 @@ presenceToHandler.set(presence, fulfilledHandler); | ||
// Remove the mapping, as our fulfilledHandler should be used instead. | ||
promiseToHandler.delete(handledP); | ||
// We need to invoke fulfilledHandler immediately, so add it | ||
// to the mapping. | ||
promiseToHandler.set(handledP, fulfilledHandler); | ||
@@ -193,0 +194,0 @@ // We committed to this presence, so resolve. |
@@ -34,6 +34,7 @@ (function (global, factory) { | ||
if (typeof h[operation] !== 'function') { | ||
const handlerName = h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler'; | ||
const handlerName = | ||
h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler'; | ||
throw TypeError(`${handlerName}.${operation} is not a function`); | ||
} | ||
return h[operation](p, ...args); | ||
return Promise.resolve(h[operation](p, ...args)); | ||
} | ||
@@ -189,3 +190,2 @@ | ||
if (!presenceToHandler.has(presence)) { | ||
// Create table entries for the presence mapped to the fulfilledHandler. | ||
presenceToPromise.set(presence, handledP); | ||
@@ -195,4 +195,5 @@ presenceToHandler.set(presence, fulfilledHandler); | ||
// Remove the mapping, as our fulfilledHandler should be used instead. | ||
promiseToHandler.delete(handledP); | ||
// We need to invoke fulfilledHandler immediately, so add it | ||
// to the mapping. | ||
promiseToHandler.set(handledP, fulfilledHandler); | ||
@@ -199,0 +200,0 @@ // We committed to this presence, so resolve. |
{ | ||
"name": "@agoric/eventual-send", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Extend a Promise class to implement the eventual-send API", | ||
@@ -5,0 +5,0 @@ "main": "dist/eventual-send.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
688
41645