test-nat: assert that requireMode doesn't add Nat as a global
MODIFY
test/test-nat.js
test/test-nat.js
@@ -13,3 +13,16 @@ test('SES environment does not have Nat as a global', t => {
t.throws(() => n(0), s.global.ReferenceError);
t.end();
});
+
+test('SES environment does not have Nat as a global despite require()', t => {
+ const s = SES.makeSESRootRealm({ requireMode: 'allow' });
+ t.equal(typeof s.global.Nat, 'undefined');
+ function check() {
+ const n = x => Nat(x); // eslint-disable-line no-undef
+ return { n };
+ }
+ const { n } = s.evaluate(`${check}; check()`);
+
+ t.throws(() => n(0), s.global.ReferenceError);
+ t.end();
+});

test-nat: assert that requireMode doesn't add Nat as a global