Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/resolve/lib/caller.js')
-rw-r--r--node_modules/resolve/lib/caller.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/node_modules/resolve/lib/caller.js b/node_modules/resolve/lib/caller.js
new file mode 100644
index 000000000..b14a2804a
--- /dev/null
+++ b/node_modules/resolve/lib/caller.js
@@ -0,0 +1,8 @@
+module.exports = function () {
+ // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+ var origPrepareStackTrace = Error.prepareStackTrace;
+ Error.prepareStackTrace = function (_, stack) { return stack; };
+ var stack = (new Error()).stack;
+ Error.prepareStackTrace = origPrepareStackTrace;
+ return stack[2].getFileName();
+};