Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(daemon): Make web-page-js formula numbered #2065

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/daemon/src/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,15 @@ const makeEndoBootstrap = (
return { external: endoBootstrap, internal: undefined };
} else if (formulaType === 'least-authority-id512') {
return { external: leastAuthority, internal: undefined };
} else if (formulaIdentifier === 'web-page-js') {
} else if (formulaType === 'web-page-js-id512') {
if (persistencePowers.webPageBundlerFormula === undefined) {
throw Error('No web-page-js formula provided.');
throw Error('No web-page-js-id512 formula provided.');
}
if (formulaNumber !== zero512) {
throw Error('Invalid web-page-js-id512 formula number.');
}
return makeControllerForFormula(
'web-page-js',
formulaIdentifier,
zero512,
persistencePowers.webPageBundlerFormula,
terminator,
Expand Down Expand Up @@ -762,7 +765,8 @@ const makeEndoBootstrap = (

leastAuthority: () => leastAuthority,

webPageJs: () => provideValueForFormulaIdentifier('web-page-js'),
webPageJs: () =>
provideValueForFormulaIdentifier(`web-page-js-id512:${zero512}`),

importAndEndowInWebPage: async (webPageP, webPageNumber) => {
const { bundle: bundleBlob, powers: endowedPowers } =
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/formula-identifier.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { quote: q } = assert;

const numberlessFormulasIdentifiers = new Set(['endo', 'web-page-js']);
const numberlessFormulasIdentifiers = new Set(['endo']);

/**
* @param {string} formulaIdentifier
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/web-page-bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// This is a built-in unconfined plugin for lazily constructing the web-page.js
// bundle for booting up web caplets.
// The hard-coded 'web-page-js' formula is a hard-coded 'make-unconfined' formula
// The hard-coded 'web-page-js-id512' formula is a hard-coded 'make-unconfined' formula
// that runs this program in worker 0.
// It does not accept its endowed powers.

Expand Down
Loading