From 34671fca59ed3f66678434e5ff0686974ac25140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Mon, 16 Mar 2015 13:54:30 +0100 Subject: [PATCH] Revert fix for jQueryEventTriggers --- .../phantomas/custom_modules/core/scopeYLT/scopeYLT.js | 2 +- lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js b/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js index b4a97e9..4ec31ef 100644 --- a/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js +++ b/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js @@ -36,7 +36,7 @@ exports.module = function(phantomas) { phantomas.log('Overwritting phantomas spy function'); function spy(obj, fn, callbackBefore, callbackAfter) { - var origFn = obj[fn]; + var origFn = obj && obj[fn]; if (typeof origFn !== 'function') { return false; diff --git a/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js b/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js index bb7762a..f2403a8 100644 --- a/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js @@ -17,7 +17,7 @@ exports.module = function(phantomas) { phantomas.setMetric('jQueryOnDOMReadyFunctions'); // @desc number of functions bound to onDOMReady event phantomas.setMetric('jQueryWindowOnLoadFunctions'); // @desc number of functions bound to windowOnLoad event phantomas.setMetric('jQuerySizzleCalls'); // @desc number of calls to Sizzle (including those that will be resolved using querySelectorAll) - //phantomas.setMetric('jQueryEventTriggers'); // @desc number of jQuery event triggers + phantomas.setMetric('jQueryEventTriggers'); // @desc number of jQuery event triggers var jQueryFunctions = [ // DOM manipulations @@ -245,7 +245,7 @@ exports.module = function(phantomas) { }); - /*if (!jQuery.event) { + if (!jQuery.event) { phantomas.spy(jQuery.event, 'trigger', function(ev, data, elem) { var path = phantomas.getDOMPath(elem), type = ev.type || ev; @@ -255,7 +255,7 @@ exports.module = function(phantomas) { phantomas.incrMetric('jQueryEventTriggers'); phantomas.addOffender('jQueryEventTriggers', '"%s" on "%s"', type, path); }); - }*/ + } // jQuery events bound to window' onLoad event (#451) phantomas.spy(jQuery.fn, 'on', function(eventName, func) {