Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: endojs/endo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ffeb539b9f77ea45719d93f363766a01d11976fa
Choose a base ref
..
head repository: endojs/endo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8c1801cd61a9217e8e9babe91f8f85030475aa3
Choose a head ref

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

1 change: 0 additions & 1 deletion packages/ses/src/commons.js
Original file line number Diff line number Diff line change
@@ -70,7 +70,6 @@ export const defineProperty = (object, prop, descriptor) => {
export const { apply, construct, get: reflectGet, set: reflectSet } = Reflect;

export const { isArray, prototype: arrayPrototype } = Array;
export const { symbolUnscopables } = Symbol;
export const { prototype: mapPrototype } = Map;
export const { revocable: proxyRevocable } = Proxy;
export const { prototype: regexpPrototype } = RegExp;
16 changes: 16 additions & 0 deletions packages/ses/test/test-confinement.js
Original file line number Diff line number Diff line change
@@ -61,3 +61,19 @@ test('confinement evaluation eval', t => {
t.is(c.evaluate('(0, eval)("this")'), c.globalThis);
t.is(c.evaluate('var evil = eval; evil("this")'), c.globalThis);
});

test('confinement evaluation Symbol.unscopables with-statement escape', t => {
t.plan(2);

globalThis.flag = 'unsafe';

const c = new Compartment({ flag: 'safe' });

t.is(c.evaluate('Symbol.unscopables'), Symbol.unscopables);
t.is(
c.evaluate('globalThis[Symbol.unscopables] = { flag: true }; flag'),
'safe',
);

delete globalThis.flag;
});