Skip to content
Browse files

Add coloring for windows terminal

  • Loading branch information...
1 parent a04451b commit a4c9760a68d8558da56a05e046638bda78a94a1d @CrabDude committed Feb 6, 2012
View
0 LICENSE 100644 → 100755
File mode changed.
View
0 README.md 100644 → 100755
File mode changed.
View
0 examples/helloworld.js 100644 → 100755
File mode changed.
View
0 examples/server.js 100644 → 100755
File mode changed.
View
0 examples/setTimeout.js 100644 → 100755
File mode changed.
View
0 lib/formatStackTrace.js 100644 → 100755
File mode changed.
View
0 lib/hook.js 100644 → 100755
File mode changed.
View
6 lib/trycatch.js 100644 → 100755
@@ -2,6 +2,8 @@ module.exports = trycatch;
// use colors module, if available
try { trycatch.colors = require('colors'); } catch(err) {}
var FormatStackTrace = require('./formatStackTrace');
+var path = require('path');
+var d = path.join('/');
// findToken fails for stack traces deeper Error.stackTraceLimit => Error.stackTraceLimit = Infinity
@@ -103,9 +105,9 @@ function filterInternalFrames(frames) {
});
if (trycatch.colors) {
ret = ret.map(function(frame, k) {
- if (frame.indexOf('/node_modules/') >= 0) {
+ if (frame.indexOf(d + 'node_modules' + d) >= 0) {
frame = trycatch.colors.cyan(frame);
- } else if (frame.indexOf('/') >= 0) {
+ } else if (frame.indexOf(d) >= 0) {
frame = trycatch.colors.red(frame);
}
return frame;
View
2 package.json 100644 → 100755
@@ -1,6 +1,6 @@
{
"name" : "trycatch",
- "version" : "0.0.10",
+ "version" : "0.0.11",
"description" : "An asynchronous exception handler with long stack traces for node.js",
"homepage": "http://github.com/CrabDude/trycatch",
"repository": {
View
0 test/throw-string.test.js 100644 → 100755
File mode changed.

0 comments on commit a4c9760

Please sign in to comment.
Something went wrong with that request. Please try again.