From 42dcd40d4e041e7163ef1af83db1cd562d8fc948 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 12 Jul 2024 15:09:28 -0700 Subject: [PATCH] fix(ses): turn agoric #9700 into an Endo PR --- packages/ses/src/error/tame-error-constructor.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/ses/src/error/tame-error-constructor.js b/packages/ses/src/error/tame-error-constructor.js index 2788c423a1..c7f05185ef 100644 --- a/packages/ses/src/error/tame-error-constructor.js +++ b/packages/ses/src/error/tame-error-constructor.js @@ -173,12 +173,14 @@ export default function tameErrorConstructor( let initialGetStackString = tamedMethods.getStackString; if (platform === 'v8') { - initialGetStackString = tameV8ErrorConstructor( - FERAL_ERROR, - InitialError, - errorTaming, - stackFiltering, - ); + if (errorTaming === 'safe') { + initialGetStackString = tameV8ErrorConstructor( + FERAL_ERROR, + InitialError, + errorTaming, + stackFiltering, + ); + } } else if (errorTaming === 'unsafe') { // v8 has too much magic around their 'stack' own property for it to // coexist cleanly with this accessor. So only install it on non-v8