diff options
author | portix <none@none> | 2013-02-25 16:54:06 +0100 |
---|---|---|
committer | portix <none@none> | 2013-02-25 16:54:06 +0100 |
commit | a3f52da4ba27a1634b484409c46ab70228397ba4 (patch) | |
tree | ce914f36a4ca9672bc2a96fd67bc481326d7220a /scripts | |
parent | 09065041687297ebd3b6c3ccda1ed4c0f381ca8d (diff) | |
download | dwb-a3f52da4ba27a1634b484409c46ab70228397ba4.zip |
Add path to Function.debug
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/dwb.js | 15 | ||||
-rw-r--r-- | scripts/lib/io.js | 4 |
2 files changed, 12 insertions, 7 deletions
diff --git a/scripts/lib/dwb.js b/scripts/lib/dwb.js index ba5f2754..8691ab9e 100644 --- a/scripts/lib/dwb.js +++ b/scripts/lib/dwb.js @@ -218,10 +218,15 @@ Object.defineProperty(Function.prototype, "debug", { value : function(scope) { - var callee; + var callee, path; var self = this; - if (scope && scope.arguments && scope.arguments.callee) - callee = String(scope.arguments.callee); + if (scope) + { + if (scope.arguments && scope.arguments.callee) + callee = String(scope.arguments.callee); + if (scope.path) + path = scope.path; + } return function() { try { @@ -229,8 +234,8 @@ } catch (e) { - if (callee) - e.callee = callee; + e.callee = callee || undefined; + e.path = path || undefined; io.debug(e); } }; diff --git a/scripts/lib/io.js b/scripts/lib/io.js index 77878198..9050abb6 100644 --- a/scripts/lib/io.js +++ b/scripts/lib/io.js @@ -40,8 +40,8 @@ error = params.error; } - if (this.path) - outMessage += prefixFile + this.path; + if (params.path || this.path) + outMessage += prefixFile + (params.path || this.path); if (message) outMessage += prefixMessage + message; |