From 490dbed707f897f63f5c3a383b545298af6cc657 Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:22:51 +0100 Subject: [PATCH] refactor(ses): completePrototypes on Hermes condition Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- packages/ses/src/intrinsics.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/ses/src/intrinsics.js b/packages/ses/src/intrinsics.js index ef0c9d59d2..dac74e8a27 100644 --- a/packages/ses/src/intrinsics.js +++ b/packages/ses/src/intrinsics.js @@ -106,13 +106,11 @@ export const makeIntrinsicsCollector = () => { // - arguments {"enumerable":false,"configurable":false} from [[Proto]]: %FunctionPrototype% // - prototype {"value":{},"writable":true,"enumerable":false,"configurable":false} // so we tolerate the unexpected prototype property instead of throwing an Error. - if ( - name === 'lockdown' || - name === 'harden' || - name === '%InitialGetStackString%' - ) + const IGNORED_PROTOTYPE_PERMITS = ['lockdown', 'harden', '%InitialGetStackString%']; + if (IGNORED_PROTOTYPE_PERMITS.includes(name)) { // eslint-disable-next-line no-continue continue; + } throw TypeError(`${name}.prototype property not whitelisted`); } if (