@@ -165,6 +165,7 @@ export type Constants = Remap<
165165 readonly instrumentWithSentryPath : string
166166 readonly minimumVersionByAgent : Map < Agent , string >
167167 readonly nmBinPath : string
168+ readonly nodeDebugFlags : string [ ]
168169 readonly nodeHardenFlags : string [ ]
169170 readonly nodeMemoryFlags : string [ ]
170171 readonly npmCachePath : string
@@ -492,23 +493,33 @@ const lazyMinimumVersionByAgent = () =>
492493
493494const lazyNmBinPath = ( ) => path . join ( constants . rootPath , 'node_modules/.bin' )
494495
496+ const lazyNodeDebugFlags = ( ) =>
497+ constants . ENV . SOCKET_CLI_DEBUG ? [ '--trace-uncaught' , '--trace-warnings' ] : [ ]
498+
495499// Redefine registryConstants.nodeHardenFlags to account for the
496500// INLINED_SOCKET_CLI_SENTRY_BUILD environment variable.
497501const lazyNodeHardenFlags = ( ) =>
498502 Object . freeze (
503+ // Harden Node security.
504+ // https://nodejs.org/en/learn/getting-started/security-best-practices
499505 constants . ENV . INLINED_SOCKET_CLI_SENTRY_BUILD || constants . WIN32
500- ? [ ]
501- : // Harden Node security.
502- // https://nodejs.org/en/learn/getting-started/security-best-practices
503- [
504- '--disable-proto' ,
505- 'throw' ,
506+ ? [
507+ // https://nodejs.org/api/cli.html#--disallow-code-generation-from-strings
508+ // '--disallow-code-generation-from-strings'
509+ ]
510+ : [
511+ // '--disallow-code-generation-from-strings',
512+ // https://nodejs.org/api/cli.html#--disable-protomode
513+ // '--disable-proto',
514+ // 'throw',
515+ // https://nodejs.org/api/cli.html#--frozen-intrinsics
506516 // We have contributed the following patches to our dependencies to make
507517 // Node's --frozen-intrinsics workable.
508518 // √ https://github.com/SBoudrias/Inquirer.js/pull/1683
509519 // √ https://github.com/pnpm/components/pull/23
510- '--frozen-intrinsics' ,
511- '--no-deprecation' ,
520+ // '--frozen-intrinsics',
521+ // https://nodejs.org/api/cli.html#--no-deprecation
522+ // '--no-deprecation',
512523 ] ,
513524 )
514525
@@ -677,6 +688,7 @@ const constants: Constants = createConstantsObject(
677688 minimumVersionByAgent : undefined ,
678689 nmBinPath : undefined ,
679690 nodeHardenFlags : undefined ,
691+ nodeDebugFlags : undefined ,
680692 nodeMemoryFlags : undefined ,
681693 npmCachePath : undefined ,
682694 npmGlobalPrefix : undefined ,
@@ -709,6 +721,7 @@ const constants: Constants = createConstantsObject(
709721 instrumentWithSentryPath : lazyInstrumentWithSentryPath ,
710722 minimumVersionByAgent : lazyMinimumVersionByAgent ,
711723 nmBinPath : lazyNmBinPath ,
724+ nodeDebugFlags : lazyNodeDebugFlags ,
712725 nodeHardenFlags : lazyNodeHardenFlags ,
713726 nodeMemoryFlags : lazyNodeMemoryFlags ,
714727 npmCachePath : lazyNpmCachePath ,
0 commit comments