fix: adds some missing hardens
MODIFY
packages/bundle-source/src/index.js
packages/bundle-source/src/index.js
@@ -151,7 +151,7 @@ async function bundleZipBase64(startFilename, dev, powers = {}) {
},
});
const endoZipBase64 = encodeBase64(bytes);
- return { endoZipBase64, moduleFormat: 'endoZipBase64' };
+ return harden({ endoZipBase64, moduleFormat: 'endoZipBase64' });
}
async function bundleNestedEvaluateAndGetExports(
@@ -382,7 +382,7 @@ ${sourceMap}`;
}
// console.log(sourceMap);
- return { source, sourceMap, moduleFormat };
+ return harden({ source, sourceMap, moduleFormat });
}
/** @type {BundleSource} */

MODIFY
packages/import-bundle/test/test-import-bundle.js
packages/import-bundle/test/test-import-bundle.js
@@ -100,8 +100,8 @@ test('test missing sourceMap', async function testImport(t) {
url.fileURLToPath(new URL('bundle1.js', import.meta.url)),
'nestedEvaluate',
);
- delete b1.sourceMap;
- const ns1 = await importBundle(b1, { endowments });
+ const { sourceMap: _, ...b2 } = b1;
+ const ns1 = await importBundle(b2, { endowments });
t.is(ns1.f1(1), 2, `missing sourceMap ns.f1 ok`);
});

fix: adds some missing hardens (#1077)