endo: Unable to import 'tape' v4 or v5 after lockdown
This program:
// install-ses.js consists of:
// import { lockdown } from 'ses';
// lockdown();
import './install-ses.js';
import { test } from 'tape';
when run against SES-0.7.7, with a node_modules that has tape-4.11.0, fails like this:
$ node -r esm fail-import-tape.js
/home/warner/stuff/agoric/agoric-sdk/node_modules/string.prototype.trim/node_modules/es-abstract/helpers/callBind.js:1
TypeError: Cannot assign to read only property 'apply' of function 'function callBind() {
return bind.apply($call, arguments);
}'
at Object.<anonymous> (/home/warner/stuff/agoric/agoric-sdk/node_modules/string.prototype.trim/node_modules/es-abstract/helpers/callBind.js:15:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
I tried disabling various taming options in lockdown() and it didn’t help.
I’m guessing that tape is using some module (es-abstract?) which thinks it can modify the primordials. We could find a way to accomodate that, or find a way to make it stop.
I’m able to import tape before lockdown, and tests seem to work normally, which is what I’ll do for now. That makes it a ‘vetted shim’, though, and it’s neither vetted nor a shim. Discuss.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (17 by maintainers)
Commits related to this issue
- fix test-network * disable typescript checking, which used a trick to swap 'harden' out for one that was annotated, but now 'harden' is a (frozen) global and cannot be swapped out like that * rep... — committed to Agoric/agoric-sdk by warner 4 years ago
- add enablements to fix tape-4.x This adds `FunctionPrototype.apply`, as well as `.message` for all the various Error prototypes, to the enablements list. This allows tape-4.x to be imported after lo... — committed to endojs/endo by warner 4 years ago
- add enablements to fix tape-4.x This adds `FunctionPrototype.apply`, as well as `.message` for all the various Error prototypes, to the enablements list. This allows tape-4.x to be imported after lo... — committed to endojs/endo by warner 4 years ago
- add enablements to fix tape-4.x This adds `FunctionPrototype.apply`, as well as `.message` for all the various Error prototypes, to the enablements list. This allows tape-4.x to be imported after lo... — committed to endojs/endo by warner 4 years ago
- add enablements to fix tape-4.x This adds `FunctionPrototype.apply`, as well as `.message` for all the various Error prototypes, to the enablements list. This allows tape-4.x to be imported after lo... — committed to endojs/endo by warner 4 years ago
- add enablements to fix tape-4.x This adds `FunctionPrototype.apply`, as well as `.message` for all the various Error prototypes, to the enablements list. This allows tape-4.x to be imported after lo... — committed to endojs/endo by warner 4 years ago
- repair more properties, to fix tape-4.x (#293) This adds `FunctionPrototype.apply`, as well as `.message` for all the various Error prototypes, to the enablements list. This allows tape-4.x to be im... — committed to endojs/endo by warner 4 years ago
- repair more properties, to fix tape-4.x (#312) This repairs the override mistake in `FunctionPrototype.apply`, as well as `.message` for all the various Error prototypes. This allows tape-4.x to b... — committed to endojs/endo by warner 4 years ago
@warner @kriskowal I’m closing this as irrelevant, but reopen if I’m missing something or you disagree.
In summary, we discussed this at the Agoric SES meeting, and we do care about about tape versions running under SES.
cc @ljharb This is the issue that we encountered while using
tapeunderses. This motivated our prior solution, fixing overrides.