From a2217a91789b35bf23db799c7b475b08b2592a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Mon, 3 Nov 2014 11:12:27 +0100 Subject: [PATCH] Fix 'undefined' arg in JS execution tree --- package.json | 4 ++-- phantomas_custom/modules/jQYLT/jQYLT.js | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4e7203a..539835f 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/phantomas_custom/modules/jQYLT/jQYLT.js b/phantomas_custom/modules/jQYLT/jQYLT.js index a2caffd..b15e362 100644 --- a/phantomas_custom/modules/jQYLT/jQYLT.js +++ b/phantomas_custom/modules/jQYLT/jQYLT.js @@ -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'; }