Skip to content

Commit

Permalink
chore: harden the promise-space Proxy targets
Browse files Browse the repository at this point in the history
per @erights: this prevents non-get operations from mutating the
target and using it as a communications channel.
  • Loading branch information
warner committed May 12, 2023
1 parent eec0147 commit ab4bc10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vats/src/core/promise-space.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const makePromiseSpace = (optsOrLog = {}) => {
/** @type {PromiseSpaceOf<T>['consume']} */
// @ts-expect-error cast
const consume = new Proxy(
{},
harden({}),
{
get: (_target, name) => {
assert.typeof(name, 'string');
Expand All @@ -177,7 +177,7 @@ export const makePromiseSpace = (optsOrLog = {}) => {
/** @type {PromiseSpaceOf<T>['produce']} */
// @ts-expect-error cast
const produce = new Proxy(
{},
harden({}),
{
get: (_target, name) => {
assert.typeof(name, 'string');
Expand Down

0 comments on commit ab4bc10

Please sign in to comment.