@@ -19,7 +19,6 @@ import type { ProfileFormat } from './types';
19
19
// When building for ESM, we shim require to use createRequire and __dirname.
20
20
// We need to do this because .node extensions in esm are not supported.
21
21
// The comment below this line exists as a placeholder for where to insert the shim
22
- const __sentry_require = require ;
23
22
// #END_SENTRY_ESM_SHIM // If a binary path is specified, use that.
24
23
25
24
const stdlib = familySync ( ) ;
@@ -37,62 +36,62 @@ const built_from_source_path = resolve(__dirname, '..', `./sentry_cpu_profiler-$
37
36
export function importCppBindingsModule ( ) : PrivateV8CpuProfilerBindings {
38
37
if ( env [ 'SENTRY_PROFILER_BINARY_PATH' ] ) {
39
38
const envPath = env [ 'SENTRY_PROFILER_BINARY_PATH' ] ;
40
- return __sentry_require ( envPath ) ;
39
+ return require ( envPath ) ;
41
40
}
42
41
43
42
// If a user specifies a different binary dir, they are in control of the binaries being moved there
44
43
if ( env [ 'SENTRY_PROFILER_BINARY_DIR' ] ) {
45
44
const binaryPath = join ( resolve ( env [ 'SENTRY_PROFILER_BINARY_DIR' ] ) , `sentry_cpu_profiler-${ identifier } ` ) ;
46
- return __sentry_require ( `${ binaryPath } .node` ) ;
45
+ return require ( `${ binaryPath } .node` ) ;
47
46
}
48
47
49
- // We need the fallthrough so that in the end, we can fallback to the __sentry_require dynamice require.
48
+ // We need the fallthrough so that in the end, we can fallback to the require dynamice require.
50
49
// This is for cases where precompiled binaries were not provided, but may have been compiled from source.
51
50
if ( platform === 'darwin' ) {
52
51
if ( arch === 'x64' ) {
53
52
if ( abi === '93' ) {
54
- return __sentry_require ( '../sentry_cpu_profiler-darwin-x64-93.node' ) ;
53
+ return require ( '../sentry_cpu_profiler-darwin-x64-93.node' ) ;
55
54
}
56
55
if ( abi === '108' ) {
57
- return __sentry_require ( '../sentry_cpu_profiler-darwin-x64-108.node' ) ;
56
+ return require ( '../sentry_cpu_profiler-darwin-x64-108.node' ) ;
58
57
}
59
58
if ( abi === '115' ) {
60
- return __sentry_require ( '../sentry_cpu_profiler-darwin-x64-115.node' ) ;
59
+ return require ( '../sentry_cpu_profiler-darwin-x64-115.node' ) ;
61
60
}
62
61
if ( abi === '127' ) {
63
- return __sentry_require ( '../sentry_cpu_profiler-darwin-x64-127.node' ) ;
62
+ return require ( '../sentry_cpu_profiler-darwin-x64-127.node' ) ;
64
63
}
65
64
}
66
65
67
66
if ( arch === 'arm64' ) {
68
67
if ( abi === '93' ) {
69
- return __sentry_require ( '../sentry_cpu_profiler-darwin-arm64-93.node' ) ;
68
+ return require ( '../sentry_cpu_profiler-darwin-arm64-93.node' ) ;
70
69
}
71
70
if ( abi === '108' ) {
72
- return __sentry_require ( '../sentry_cpu_profiler-darwin-arm64-108.node' ) ;
71
+ return require ( '../sentry_cpu_profiler-darwin-arm64-108.node' ) ;
73
72
}
74
73
if ( abi === '115' ) {
75
- return __sentry_require ( '../sentry_cpu_profiler-darwin-arm64-115.node' ) ;
74
+ return require ( '../sentry_cpu_profiler-darwin-arm64-115.node' ) ;
76
75
}
77
76
if ( abi === '127' ) {
78
- return __sentry_require ( '../sentry_cpu_profiler-darwin-arm64-127.node' ) ;
77
+ return require ( '../sentry_cpu_profiler-darwin-arm64-127.node' ) ;
79
78
}
80
79
}
81
80
}
82
81
83
82
if ( platform === 'win32' ) {
84
83
if ( arch === 'x64' ) {
85
84
if ( abi === '93' ) {
86
- return __sentry_require ( '../sentry_cpu_profiler-win32-x64-93.node' ) ;
85
+ return require ( '../sentry_cpu_profiler-win32-x64-93.node' ) ;
87
86
}
88
87
if ( abi === '108' ) {
89
- return __sentry_require ( '../sentry_cpu_profiler-win32-x64-108.node' ) ;
88
+ return require ( '../sentry_cpu_profiler-win32-x64-108.node' ) ;
90
89
}
91
90
if ( abi === '115' ) {
92
- return __sentry_require ( '../sentry_cpu_profiler-win32-x64-115.node' ) ;
91
+ return require ( '../sentry_cpu_profiler-win32-x64-115.node' ) ;
93
92
}
94
93
if ( abi === '127' ) {
95
- return __sentry_require ( '../sentry_cpu_profiler-win32-x64-127.node' ) ;
94
+ return require ( '../sentry_cpu_profiler-win32-x64-127.node' ) ;
96
95
}
97
96
}
98
97
}
@@ -101,65 +100,65 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
101
100
if ( arch === 'x64' ) {
102
101
if ( stdlib === 'musl' ) {
103
102
if ( abi === '93' ) {
104
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-musl-93.node' ) ;
103
+ return require ( '../sentry_cpu_profiler-linux-x64-musl-93.node' ) ;
105
104
}
106
105
if ( abi === '108' ) {
107
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-musl-108.node' ) ;
106
+ return require ( '../sentry_cpu_profiler-linux-x64-musl-108.node' ) ;
108
107
}
109
108
if ( abi === '115' ) {
110
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-musl-115.node' ) ;
109
+ return require ( '../sentry_cpu_profiler-linux-x64-musl-115.node' ) ;
111
110
}
112
111
if ( abi === '127' ) {
113
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-musl-127.node' ) ;
112
+ return require ( '../sentry_cpu_profiler-linux-x64-musl-127.node' ) ;
114
113
}
115
114
}
116
115
if ( stdlib === 'glibc' ) {
117
116
if ( abi === '93' ) {
118
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-glibc-93.node' ) ;
117
+ return require ( '../sentry_cpu_profiler-linux-x64-glibc-93.node' ) ;
119
118
}
120
119
if ( abi === '108' ) {
121
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-glibc-108.node' ) ;
120
+ return require ( '../sentry_cpu_profiler-linux-x64-glibc-108.node' ) ;
122
121
}
123
122
if ( abi === '115' ) {
124
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-glibc-115.node' ) ;
123
+ return require ( '../sentry_cpu_profiler-linux-x64-glibc-115.node' ) ;
125
124
}
126
125
if ( abi === '127' ) {
127
- return __sentry_require ( '../sentry_cpu_profiler-linux-x64-glibc-127.node' ) ;
126
+ return require ( '../sentry_cpu_profiler-linux-x64-glibc-127.node' ) ;
128
127
}
129
128
}
130
129
}
131
130
if ( arch === 'arm64' ) {
132
131
if ( stdlib === 'musl' ) {
133
132
if ( abi === '93' ) {
134
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-musl-93.node' ) ;
133
+ return require ( '../sentry_cpu_profiler-linux-arm64-musl-93.node' ) ;
135
134
}
136
135
if ( abi === '108' ) {
137
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-musl-108.node' ) ;
136
+ return require ( '../sentry_cpu_profiler-linux-arm64-musl-108.node' ) ;
138
137
}
139
138
if ( abi === '115' ) {
140
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-musl-115.node' ) ;
139
+ return require ( '../sentry_cpu_profiler-linux-arm64-musl-115.node' ) ;
141
140
}
142
141
if ( abi === '127' ) {
143
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-musl-127.node' ) ;
142
+ return require ( '../sentry_cpu_profiler-linux-arm64-musl-127.node' ) ;
144
143
}
145
144
}
146
145
if ( stdlib === 'glibc' ) {
147
146
if ( abi === '93' ) {
148
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-glibc-93.node' ) ;
147
+ return require ( '../sentry_cpu_profiler-linux-arm64-glibc-93.node' ) ;
149
148
}
150
149
if ( abi === '108' ) {
151
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-glibc-108.node' ) ;
150
+ return require ( '../sentry_cpu_profiler-linux-arm64-glibc-108.node' ) ;
152
151
}
153
152
if ( abi === '115' ) {
154
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-glibc-115.node' ) ;
153
+ return require ( '../sentry_cpu_profiler-linux-arm64-glibc-115.node' ) ;
155
154
}
156
155
if ( abi === '127' ) {
157
- return __sentry_require ( '../sentry_cpu_profiler-linux-arm64-glibc-127.node' ) ;
156
+ return require ( '../sentry_cpu_profiler-linux-arm64-glibc-127.node' ) ;
158
157
}
159
158
}
160
159
}
161
160
}
162
- return __sentry_require ( `${ built_from_source_path } .node` ) ;
161
+ return require ( `${ built_from_source_path } .node` ) ;
163
162
}
164
163
165
164
const PrivateCpuProfilerBindings : PrivateV8CpuProfilerBindings = importCppBindingsModule ( ) ;
0 commit comments