summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/get-caller-file
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/get-caller-file')
-rw-r--r--deps/npm/node_modules/get-caller-file/README.md4
-rw-r--r--deps/npm/node_modules/get-caller-file/index.js20
-rw-r--r--deps/npm/node_modules/get-caller-file/package.json58
3 files changed, 82 insertions, 0 deletions
diff --git a/deps/npm/node_modules/get-caller-file/README.md b/deps/npm/node_modules/get-caller-file/README.md
new file mode 100644
index 0000000000..c32df54c39
--- /dev/null
+++ b/deps/npm/node_modules/get-caller-file/README.md
@@ -0,0 +1,4 @@
+# get-caller-file
+
+[![Build Status](https://travis-ci.org/ember-cli/ember-cli.svg?branch=master)](https://travis-ci.org/ember-cli/ember-cli)
+[![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)
diff --git a/deps/npm/node_modules/get-caller-file/index.js b/deps/npm/node_modules/get-caller-file/index.js
new file mode 100644
index 0000000000..03e7dfc39b
--- /dev/null
+++ b/deps/npm/node_modules/get-caller-file/index.js
@@ -0,0 +1,20 @@
+'use strict';
+
+// Call this function in a another function to find out the file from
+// which that function was called from. (Inspects the v8 stack trace)
+//
+// Inspired by http://stackoverflow.com/questions/13227489
+
+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;
+
+ // stack[0] holds this file
+ // stack[1] holds where this function was called
+ // stack[2] holds the file we're interested in
+ return stack[position] ? stack[position].getFileName() : undefined;
+};
diff --git a/deps/npm/node_modules/get-caller-file/package.json b/deps/npm/node_modules/get-caller-file/package.json
new file mode 100644
index 0000000000..d5c90d52fc
--- /dev/null
+++ b/deps/npm/node_modules/get-caller-file/package.json
@@ -0,0 +1,58 @@
+{
+ "_from": "get-caller-file@^1.0.1",
+ "_id": "get-caller-file@1.0.2",
+ "_inBundle": false,
+ "_integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
+ "_location": "/get-caller-file",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "get-caller-file@^1.0.1",
+ "name": "get-caller-file",
+ "escapedName": "get-caller-file",
+ "rawSpec": "^1.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.1"
+ },
+ "_requiredBy": [
+ "/yargs"
+ ],
+ "_resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
+ "_shasum": "f702e63127e7e231c160a80c1554acb70d5047e5",
+ "_spec": "get-caller-file@^1.0.1",
+ "_where": "/Users/rebecca/code/npm/node_modules/yargs",
+ "author": {
+ "name": "Stefan Penner"
+ },
+ "bugs": {
+ "url": "https://github.com/stefanpenner/get-caller-file/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "[![Build Status](https://travis-ci.org/ember-cli/ember-cli.svg?branch=master)](https://travis-ci.org/ember-cli/ember-cli) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)",
+ "devDependencies": {
+ "chai": "^3.4.1",
+ "ensure-posix-path": "^1.0.1",
+ "mocha": "^2.3.4"
+ },
+ "directories": {
+ "test": "tests"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/stefanpenner/get-caller-file#readme",
+ "license": "ISC",
+ "main": "index.js",
+ "name": "get-caller-file",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/stefanpenner/get-caller-file.git"
+ },
+ "scripts": {
+ "test": "mocha test",
+ "test:debug": "mocha test"
+ },
+ "version": "1.0.2"
+}