File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -169,11 +169,13 @@ exports.getFileName = function getFileName(calling_file) {
169
169
170
170
// run the 'prepareStackTrace' function above
171
171
Error . captureStackTrace ( dummy ) ;
172
- dummy . stack ;
172
+ noop ( dummy . stack ) ; // https://github.com/TooTallNate/node-bindings/issues/61
173
173
174
174
// cleanup
175
175
Error . prepareStackTrace = origPST ;
176
176
Error . stackTraceLimit = origSTL ;
177
+
178
+ if ( ! fileName ) return "" ; // https://github.com/TooTallNate/node-bindings/issues/50#issuecomment-864171923
177
179
178
180
// handle filename that starts with "file://"
179
181
var fileSchema = 'file://' ;
@@ -184,6 +186,10 @@ exports.getFileName = function getFileName(calling_file) {
184
186
return fileName ;
185
187
} ;
186
188
189
+ function noop ( input ) {
190
+ return input ;
191
+ }
192
+
187
193
/**
188
194
* Gets the root directory of a module, given an arbitrary filename
189
195
* somewhere in the module tree. The "root directory" is the directory
You can’t perform that action at this time.
0 commit comments