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
+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';
}