Fix 'undefined' arg in JS execution tree

This commit is contained in:
Gaël Métais
2014-11-03 11:12:27 +01:00
parent 1226b4cb60
commit a2217a9178
2 changed files with 11 additions and 3 deletions
+2 -2
View File
@@ -7,10 +7,10 @@
},
"dependencies": {
"phantomas": "1.6.0",
"express": "~4.10.0",
"express": "~4.10.1",
"async": "~0.9.0",
"socket.io": "~1.2.0",
"body-parser": "~1.9.1",
"body-parser": "~1.9.2",
"compression": "1.2.0"
},
"devDependencies": {
+9 -1
View File
@@ -228,6 +228,10 @@ exports.module = function(phantomas) {
arg = phantomas.getDOMPath(arg) || 'unknown';
} else if (typeof arg === 'function') {
arg = '(function)';
} else {
try {
@@ -239,10 +243,14 @@ exports.module = function(phantomas) {
}
}
if ((typeof arg == 'string' || arg instanceof String) && arg.length > 200) {
if ((typeof arg === 'string' || arg instanceof String) && arg.length > 200) {
arg = arg.substring(0, 200) + '...';
}
if (typeof arg === 'function') {
arg = '(function)';
}
if (arg === true) {
arg = 'true';
}