1234567891011121314151617181920 |
- 'use strict';
- module.exports = function getCallerFile(_position) {
- var oldPrepareStackTrace = Error.prepareStackTrace;
- Error.prepareStackTrace = function(err, stack) { return stack; };
- var stack = new Error().stack;
- Error.prepareStackTrace = oldPrepareStackTrace;
- var position = _position ? _position : 2;
-
-
-
- return stack[position] ? stack[position].getFileName() : undefined;
- };
|