Permalink
Browse files

Merge branch 'master' of github.com:busterjs/buster

  • Loading branch information...
2 parents afe147c + 340b4b5 commit 57b88171f1f6e362b2df94bd6ba14210abf23e55 @cjohansen cjohansen committed Aug 14, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 script/phantom.js
View
@@ -17,10 +17,14 @@ page.open(captureUrl, function(status) {
}
page.onConsoleMessage = function (msg, line, id) {
- var fileName = id.split('/');
+ var composedMsg = '';
+ var fileName = id ? id.split('/') : null;
// format the output message with filename, line number and message
// weird gotcha: phantom only uses the first console.log argument it gets :(
- console.log(fileName[fileName.length-1]+', '+ line +': '+ msg);
+ composedMsg = fileName ? fileName[fileName.length-1]+', ' : '';
+ composedMsg = line ? line +': ' : '';
+ composedMsg = msg;
+ console.log(composedMsg);
};
page.onAlert = function(msg) {

0 comments on commit 57b8817

Please sign in to comment.