@agoric/eventual-send
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.13.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/eventual-send@0.12.0...@agoric/eventual-send@0.13.0) (2020-12-10) | ||
### Features | ||
* **import-bundle:** Preliminary support Endo zip hex bundle format ([#1983](https://github.com/Agoric/agoric-sdk/issues/1983)) ([983681b](https://github.com/Agoric/agoric-sdk/commit/983681bfc4bf512b6bd90806ed9220cd4fefc13c)) | ||
# [0.12.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/eventual-send@0.12.0-dev.0...@agoric/eventual-send@0.12.0) (2020-11-07) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@agoric/eventual-send", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "Extend a Promise class to implement the eventual-send API", | ||
"parsers": { | ||
"js": "mjs" | ||
}, | ||
"main": "src/no-shim.js", | ||
@@ -25,3 +28,4 @@ "types": "src/index.d.ts", | ||
"devDependencies": { | ||
"@agoric/install-ses": "^0.4.0", | ||
"@agoric/assert": "^0.2.0", | ||
"@agoric/install-ses": "^0.5.0", | ||
"ava": "^3.12.1", | ||
@@ -43,35 +47,4 @@ "esm": "^3.2.7", | ||
"extends": [ | ||
"airbnb-base", | ||
"plugin:prettier/recommended" | ||
], | ||
"env": { | ||
"es6": true | ||
}, | ||
"rules": { | ||
"implicit-arrow-linebreak": "off", | ||
"function-paren-newline": "off", | ||
"arrow-parens": "off", | ||
"strict": "off", | ||
"prefer-destructuring": "off", | ||
"no-else-return": "off", | ||
"no-console": "off", | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_" | ||
} | ||
], | ||
"no-return-assign": "off", | ||
"no-param-reassign": "off", | ||
"no-restricted-syntax": [ | ||
"off", | ||
"ForOfStatement" | ||
], | ||
"no-unused-expressions": "off", | ||
"no-loop-func": "off", | ||
"no-inner-declarations": "off", | ||
"import/prefer-default-export": "off", | ||
"import/extensions": "off" | ||
} | ||
"@agoric" | ||
] | ||
}, | ||
@@ -94,3 +67,3 @@ "prettier": { | ||
}, | ||
"gitHead": "20bc9a904a3f3768943ed51323ce14a4f609a233" | ||
"gitHead": "f9fab94b70ed22d7fcccb261af11ed8dd6348614" | ||
} |
@@ -1,3 +0,1 @@ | ||
/* global globalThis */ | ||
import { makeHandledPromise } from './src/index'; | ||
@@ -4,0 +2,0 @@ |
10
src/E.js
@@ -1,2 +0,2 @@ | ||
/* global harden */ | ||
import { trackTurns } from './track-turns'; | ||
@@ -25,2 +25,3 @@ // eslint-disable-next-line spaced-comment | ||
* @param {*} x Any value passed to E(x) | ||
* @param {*} HandledPromise | ||
* @returns {ProxyHandler} the Proxy handler | ||
@@ -54,2 +55,3 @@ */ | ||
* @param {*} x Any value passed to E.sendOnly(x) | ||
* @param {*} HandledPromise | ||
* @returns {ProxyHandler} the Proxy handler | ||
@@ -101,6 +103,8 @@ */ | ||
E.when = (x, onfulfilled = undefined, onrejected = undefined) => | ||
HandledPromise.resolve(x).then(onfulfilled, onrejected); | ||
E.when = (x, onfulfilled = undefined, onrejected = undefined) => { | ||
const [onsuccess, onfailure] = trackTurns([onfulfilled, onrejected]); | ||
return HandledPromise.resolve(x).then(onsuccess, onfailure); | ||
}; | ||
return harden(E); | ||
} |
@@ -1,2 +0,2 @@ | ||
/* global harden */ | ||
import { trackTurns } from './track-turns'; | ||
@@ -27,3 +27,3 @@ const { | ||
* | ||
* @return {typeof HandledPromise} Handled promise | ||
* @returns {typeof HandledPromise} Handled promise | ||
*/ | ||
@@ -393,2 +393,5 @@ export function makeHandledPromise() { | ||
ensureMaps(); | ||
// eslint-disable-next-line no-use-before-define | ||
const doIt = (handler, o) => handler[operation](o, ...opArgs, returnedP); | ||
const [trackedDoIt] = trackTurns([doIt]); | ||
const returnedP = new HandledPromise((resolve, reject) => { | ||
@@ -405,3 +408,3 @@ // We run in a future turn to prevent synchronous attacks, | ||
try { | ||
resolve(handler[operation](o, ...opArgs, returnedP)); | ||
resolve(trackedDoIt(handler, o)); | ||
} catch (reason) { | ||
@@ -408,0 +411,0 @@ reject(reason); |
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
107546
13
2256
6