Skip to content

Commit

Permalink
fix(ses): review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jun 24, 2023
1 parent 8cca7db commit 8e9ead0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/ses/test/test-sloppy-globals-scope-terminator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test('sloppyGlobalsScopeTerminator/getPrototypeOf - has null prototype', t => {
});

test('sloppyGlobalsScopeTerminator/getOwnPropertyDescriptor - always has start compartment properties but provides no prop desc', t => {
t.plan(4);
t.plan(5);

const globalObject = {};
const scopeTerminator = createSloppyGlobalsScopeTerminator(globalObject);
Expand All @@ -55,10 +55,11 @@ test('sloppyGlobalsScopeTerminator/getOwnPropertyDescriptor - always has start c
t.is(Reflect.getOwnPropertyDescriptor(scopeTerminator, 'eval'), undefined);
t.is(Reflect.has(scopeTerminator, 'xyz'), true);
t.is(Reflect.getOwnPropertyDescriptor(scopeTerminator, 'xyz'), undefined);
t.deepEqual(Reflect.ownKeys(scopeTerminator), []);
});

test('sloppyGlobalsScopeTerminator/etc - all other handlers throw errors', t => {
t.plan(8);
t.plan(7);

const globalObject = {};
const scopeTerminator = createSloppyGlobalsScopeTerminator(globalObject);
Expand All @@ -72,7 +73,6 @@ test('sloppyGlobalsScopeTerminator/etc - all other handlers throw errors', t =>
instanceOf: Error,
});
t.throws(() => Reflect.isExtensible(scopeTerminator), { instanceOf: Error });
t.throws(() => Reflect.ownKeys(scopeTerminator), { instanceOf: Error });
t.throws(() => Reflect.preventExtensions(scopeTerminator), {
instanceOf: Error,
});
Expand Down
6 changes: 3 additions & 3 deletions packages/ses/test/test-strict-scope-terminator.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('strictScopeTerminator/getPrototypeOf - has null prototype', t => {
});

test('strictScopeTerminator/getOwnPropertyDescriptor - always has start compartment properties but provides no prop desc', t => {
t.plan(8);
t.plan(9);

const originalWarn = console.warn;
let didWarn = 0;
Expand All @@ -52,13 +52,14 @@ test('strictScopeTerminator/getOwnPropertyDescriptor - always has start compartm
Reflect.getOwnPropertyDescriptor(strictScopeTerminator, 'xyz'),
undefined,
);
t.deepEqual(Reflect.ownKeys(strictScopeTerminator), []);
t.is(didWarn, 2);

console.warn = originalWarn;
});

test('strictScopeTerminator/etc - all other handlers throw errors', t => {
t.plan(8);
t.plan(7);

t.throws(() => Reflect.apply(strictScopeTerminator), { instanceOf: Error });
t.throws(() => Reflect.construct(strictScopeTerminator), {
Expand All @@ -73,7 +74,6 @@ test('strictScopeTerminator/etc - all other handlers throw errors', t => {
t.throws(() => Reflect.isExtensible(strictScopeTerminator), {
instanceOf: Error,
});
t.throws(() => Reflect.ownKeys(strictScopeTerminator), { instanceOf: Error });
t.throws(() => Reflect.preventExtensions(strictScopeTerminator), {
instanceOf: Error,
});
Expand Down

0 comments on commit 8e9ead0

Please sign in to comment.