Skip to content

Commit

Permalink
fix(compartment-mapper): handle passing and reading exports reference (
Browse files Browse the repository at this point in the history
  • Loading branch information
naugtur authored Apr 5, 2022
1 parent 6663f25 commit 3b7584a
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ export const wrap = (moduleEnvironmentRecord, compartment, resolvedImports) => {
moduleEnvironmentRecord.default[prop] = value;
};

const originalExports = new Proxy(Object.create(null), {
get(target, prop) {
return moduleEnvironmentRecord.default[prop];
},
const originalExports = new Proxy(moduleEnvironmentRecord.default, {
set(_target, prop, value) {
assignProp(prop, value);
return true;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/compartment-mapper/test/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { makeReadPowers } from '../src/node-powers.js';
export const readPowers = makeReadPowers({ fs, crypto, url });

const globals = {
// process: { _rawDebug: process._rawDebug }, // useful for debugging
globalProperty: 42,
globalLexical: 'global', // should be overshadowed
};
Expand Down
2 changes: 1 addition & 1 deletion packages/compartment-mapper/test/test-cjs-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const fixture = new URL(
const assertFixture = (t, { namespace }) => {
const { assertions } = namespace;

assertions.packageReferencingItself();
assertions.packageExportsShenanigans();
assertions.packageWithDefaultField();
assertions.moduleWithDefaultField();
assertions.parserStruggles();
Expand Down

0 comments on commit 3b7584a

Please sign in to comment.