Skip to content

Commit

Permalink
fix(swingset): remove 'require' from vatEndowments
Browse files Browse the repository at this point in the history
Vats no longer get `harden` via require, and they aren't allowed to `require`
anything else either, so this removes the endowment entirely.

refs #1214
  • Loading branch information
warner committed Jul 22, 2020
1 parent 5ecea08 commit 4b584df
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/SwingSet/src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,8 @@ export async function buildVatController(config, argv = []) {
// the same is true for the tildot transform
const transformTildot = harden(makeTransform(babelParser, babelGenerate));

// Allow vats to import certain modules, by providing them the same values
// we imported here in the kernel, which came themselves from
// kernelRequire() defined in the controller. This will go away once
// 'harden' is used as a global everywhere, and vats no longer need to
// import anything outside their bundle.

function vatRequire(what) {
throw Error(`vatRequire unprepared to satisfy require(${what})`);
}

function makeVatEndowments(consoleTag) {
return harden({
require: vatRequire,
console: makeConsole(`SwingSet:${consoleTag}`),
HandledPromise,
// re2 is a RegExp work-a-like that disables backtracking expressions for
Expand Down

0 comments on commit 4b584df

Please sign in to comment.