diff --git a/packages/non-trapping-shim/README.md b/packages/non-trapping-shim/README.md index 1207ff7a0b..f4c99a04a4 100644 --- a/packages/non-trapping-shim/README.md +++ b/packages/non-trapping-shim/README.md @@ -1,4 +1,4 @@ -# Ponyfill and Shim for Non-trapping Integrity Trait +# Shim for Non-trapping Integrity Trait Emulates support for the non-trapping integrity trait from the [Stabilize proposal](https://github.com/tc39/proposal-stabilize). @@ -7,6 +7,8 @@ A *shim* attempts to be as full fidelity as practical an emulation of the propos A shim typically "exports" its functionality by adding properties to primordial objects. A ponyfill typically exports its functionality by explicit module exports, to be explicitly imported by code wishing to use it. +This package is currently organized internally as a ponyfill, and a shim based on that ponyfill. But it no longer exports the ponyfill, as the [eval twin problems](https://github.com/endojs/endo/issues/1583) for using the ponyfill are fatal. + See https://github.com/endojs/endo/blob/master/packages/ses/docs/preparing-for-stabilize.md for guidance on how to prepare for the changes that will be introduced by this proposal. TODO: More explanation. diff --git a/packages/non-trapping-shim/index.js b/packages/non-trapping-shim/index.js deleted file mode 100644 index e61784152d..0000000000 --- a/packages/non-trapping-shim/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './src/non-trapping-pony.js'; diff --git a/packages/non-trapping-shim/package.json b/packages/non-trapping-shim/package.json index 0e22fb507b..315acd9aed 100644 --- a/packages/non-trapping-shim/package.json +++ b/packages/non-trapping-shim/package.json @@ -2,7 +2,7 @@ "name": "@endo/non-trapping-shim", "version": "0.1.0", "private": true, - "description": "shim and ponyfill for non-trapping integrity trait", + "description": "shim of the non-trapping integrity trait", "keywords": [], "author": "Endo contributors", "license": "Apache-2.0", @@ -19,7 +19,6 @@ "main": "./index.js", "module": "./index.js", "exports": { - ".": "./index.js", "./shim.js": "./shim.js", "./package.json": "./package.json" }, diff --git a/packages/non-trapping-shim/src/non-trapping-pony.js b/packages/non-trapping-shim/src/non-trapping-pony.js index 1428dea7d1..85590289a1 100644 --- a/packages/non-trapping-shim/src/non-trapping-pony.js +++ b/packages/non-trapping-shim/src/non-trapping-pony.js @@ -1,3 +1,8 @@ +// The exports of this ponyfill should only be used internally to this package +// for separate unit testing, and for building the shim. The eval-twin +// problems https://github.com/endojs/endo/issues/1583 with using a ponyfill +// of this package are fatal, and so only the shim should be used externally. + const OriginalObject = Object; const OriginalReflect = Reflect; const OriginalProxy = Proxy; diff --git a/packages/non-trapping-shim/test/non-trapping-shim.test.js b/packages/non-trapping-shim/test/non-trapping-shim.test.js index 9279928d29..6c4695aa8e 100644 --- a/packages/non-trapping-shim/test/non-trapping-shim.test.js +++ b/packages/non-trapping-shim/test/non-trapping-shim.test.js @@ -6,7 +6,7 @@ import '../shim.js'; const { freeze, isFrozen } = Object; -test('non-trapping-pony', async t => { +test('non-trapping-shim', async t => { const specimen = { foo: 8 }; const sillyHandler = freeze({