@agoric/eventual-send
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -6,2 +6,22 @@ # Change Log | ||
# [0.11.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/eventual-send@0.10.0...@agoric/eventual-send@0.11.0) (2020-09-16) | ||
### Bug Fixes | ||
* allow local Presences to receive deliveries as well ([93c8933](https://github.com/Agoric/agoric-sdk/commit/93c8933b5c2bdafec26b325e0d3fc6e88978d199)), closes [#1719](https://github.com/Agoric/agoric-sdk/issues/1719) | ||
* implement epochs and make tolerant of restarts ([1c786b8](https://github.com/Agoric/agoric-sdk/commit/1c786b861a445891d09df2f1a47d689d641a0c5f)) | ||
* minor updates from PR review ([aa37b4f](https://github.com/Agoric/agoric-sdk/commit/aa37b4f4439faa846ced5653c7963798f44e872e)) | ||
* restoring most state, just need to isolate the plugin captp ([f92ee73](https://github.com/Agoric/agoric-sdk/commit/f92ee731afa69435b10b94cf4a483f25bed7a668)) | ||
### Features | ||
* implement CapTP forwarding over a plugin device ([b4a1be8](https://github.com/Agoric/agoric-sdk/commit/b4a1be8f600d60191570a3bbf42bc4c82af47b06)) | ||
* implement makeLoopback and makeFar without a membrane ([b0bccba](https://github.com/Agoric/agoric-sdk/commit/b0bccbabecc2902c9d9f7319ffb0c509bccc2d01)) | ||
# [0.10.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/eventual-send@0.9.3...@agoric/eventual-send@0.10.0) (2020-08-31) | ||
@@ -8,0 +28,0 @@ |
{ | ||
"name": "@agoric/eventual-send", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Extend a Promise class to implement the eventual-send API", | ||
@@ -9,2 +9,3 @@ "main": "src/no-shim.js", | ||
"test": "ava", | ||
"test:nyc": "nyc ava", | ||
"build": "exit 0", | ||
@@ -25,5 +26,6 @@ "lint-fix": "eslint --fix '**/*.js'", | ||
"devDependencies": { | ||
"@agoric/install-ses": "^0.3.0", | ||
"ava": "^3.11.1", | ||
"@agoric/install-ses": "^0.3.1", | ||
"ava": "^3.12.1", | ||
"esm": "^3.2.7", | ||
"nyc": "^15.1.0", | ||
"rollup": "^1.2.2" | ||
@@ -94,3 +96,3 @@ }, | ||
}, | ||
"gitHead": "709048cc133b0b2b26a9774315c18c5e828ea6ab" | ||
"gitHead": "f5ee0a03901539beb8e8f4aca7b20e01bfbf6ab3" | ||
} |
// Type definitions for eventual-send | ||
// TODO: Add jsdocs. | ||
type Property = string | number | symbol; | ||
type Property = string | number; | ||
@@ -34,3 +34,3 @@ type ERef<T> = PromiseLike<T> | T; | ||
target: unknown, | ||
prop: Property, | ||
prop: Property | undefined, | ||
args: unknown[] | ||
@@ -37,0 +37,0 @@ ): Promise<unknown>; |
@@ -11,2 +11,4 @@ /* global harden */ | ||
const q = JSON.stringify; | ||
// the following method (makeHandledPromise) is part | ||
@@ -112,3 +114,3 @@ // of the shim, and will not be exported by the module once the feature | ||
if (forwardedPromiseToPromise.has(handledP)) { | ||
throw new TypeError('internal: already forwarded'); | ||
throw TypeError('internal: already forwarded'); | ||
} | ||
@@ -156,3 +158,3 @@ value = shorten(value); | ||
if (forwardedPromiseToPromise.has(handledP)) { | ||
throw new TypeError('internal: already forwarded'); | ||
throw TypeError('internal: already forwarded'); | ||
} | ||
@@ -221,3 +223,3 @@ promiseToUnsettledHandler.delete(handledP); | ||
if (forwardedPromiseToPromise.has(handledP)) { | ||
throw new TypeError('internal: already forwarded'); | ||
throw TypeError('internal: already forwarded'); | ||
} | ||
@@ -232,3 +234,3 @@ handledReject(reason); | ||
if (forwardedPromiseToPromise.has(handledP)) { | ||
throw new TypeError('internal: already forwarded'); | ||
throw TypeError('internal: already forwarded'); | ||
} | ||
@@ -262,3 +264,3 @@ try { | ||
if (forwardedPromiseToPromise.has(handledP)) { | ||
throw new TypeError('internal: already forwarded'); | ||
throw TypeError('internal: already forwarded'); | ||
} | ||
@@ -364,11 +366,30 @@ try { | ||
get: makeForwarder('get', (o, key) => o[key]), | ||
applyMethod: makeForwarder('applyMethod', (o, optKey, args) => { | ||
if (optKey === undefined || optKey === null) { | ||
return o(...args); | ||
applyMethod: makeForwarder('applyMethod', (t, method, args) => { | ||
if (method === undefined || method === null) { | ||
if (!(t instanceof Function)) { | ||
const ftype = typeof t; | ||
throw TypeError(`target is not a function, typeof is ${ftype}`); | ||
} | ||
return t(...args); | ||
} | ||
// console.log(`sending`, optKey, o[optKey], o); | ||
if (typeof o[optKey] !== 'function') { | ||
throw TypeError(`o[${JSON.stringify(optKey)}] is not a function`); | ||
if (!t) { | ||
const ftype = typeof t; | ||
throw TypeError( | ||
`target cannot contain [${q(method)}], typeof is ${ftype}`, | ||
); | ||
} | ||
return o[optKey](...args); | ||
if (!(method in t)) { | ||
const names = Object.getOwnPropertyNames(t).sort(); | ||
throw TypeError(`target[${q(method)}] does not exist, has ${names}`); | ||
} | ||
if (!(t[method] instanceof Function)) { | ||
const ftype = typeof t[method]; | ||
const names = Object.getOwnPropertyNames(t).sort(); | ||
throw TypeError( | ||
`target[${q( | ||
method, | ||
)}] is not a function, typeof is ${ftype}, has ${names}`, | ||
); | ||
} | ||
return t[method](...args); | ||
}), | ||
@@ -375,0 +396,0 @@ }; |
/* global HandledPromise */ | ||
import makeE from './E'; | ||
const hp = HandledPromise; | ||
export const E = makeE(HandledPromise); | ||
export { hp as HandledPromise }; |
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
100807
2153
5