From 75f1219d97f92edb237a13490c92038c5a5c7936 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 8 Jan 2024 18:17:41 -0800 Subject: [PATCH] test(ses): Test freezing of anonymous intrinsics --- .../ses/test/test-frozen-anon-intrinsics.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packages/ses/test/test-frozen-anon-intrinsics.js diff --git a/packages/ses/test/test-frozen-anon-intrinsics.js b/packages/ses/test/test-frozen-anon-intrinsics.js new file mode 100644 index 0000000000..c628e12c13 --- /dev/null +++ b/packages/ses/test/test-frozen-anon-intrinsics.js @@ -0,0 +1,19 @@ +import test from 'ava'; +import '../index.js'; + +function makeArguments() { + // eslint-disable-next-line prefer-rest-params + return arguments; +} + +test.before(() => { + lockdown(); +}); + +test('arguments.callee getter is frozen', t => { + t.truthy( + Object.isFrozen( + Object.getOwnPropertyDescriptor(makeArguments(), 'callee').get, + ), + ); +});