From a00b1a96c7bc1a9bb46e51f1dce73e4947b91d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 23 Mar 2016 17:21:26 +0200 Subject: [PATCH] Fix a bug when there is a JS redirection during the run --- lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js | 2 +- lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js | 2 +- lib/tools/phantomas/custom_modules/modules/eventYLT/eventYLT.js | 2 +- lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js | 2 +- .../modules/javaScriptBottleYLT/javaScriptBottleYLT.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js b/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js index 5bd04d3..7acac57 100644 --- a/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js +++ b/lib/tools/phantomas/custom_modules/core/scopeYLT/scopeYLT.js @@ -18,7 +18,7 @@ exports.module = function(phantomas) { responseEndTime = Date.now(); }); - phantomas.once('init', function() { + phantomas.on('init', function() { phantomas.evaluate(function(responseEndTime, deepAnalysis) { (function(phantomas) { diff --git a/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js b/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js index 4d71dac..be07140 100644 --- a/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js @@ -19,7 +19,7 @@ exports.module = function(phantomas) { phantomas.setMetric('DOMqueriesAvoidable'); // @desc number of repeated uses of a duplicated query // fake native DOM functions - phantomas.once('init', function() { + phantomas.on('init', function() { phantomas.evaluate(function() { (function(phantomas) { function querySpy(type, query, fnName, context, hasNoResults) { diff --git a/lib/tools/phantomas/custom_modules/modules/eventYLT/eventYLT.js b/lib/tools/phantomas/custom_modules/modules/eventYLT/eventYLT.js index 82b678e..fd95e74 100644 --- a/lib/tools/phantomas/custom_modules/modules/eventYLT/eventYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/eventYLT/eventYLT.js @@ -12,7 +12,7 @@ exports.module = function(phantomas) { phantomas.setMetric('eventsDispatched'); // @desc number of EventTarget.dispatchEvent calls phantomas.setMetric('eventsScrollBound'); // @desc number of scroll event bounds - phantomas.once('init', function() { + phantomas.on('init', function() { phantomas.evaluate(function() { (function(phantomas) { // spy calls to EventTarget.addEventListener diff --git a/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js b/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js index 032f21e..faf3042 100644 --- a/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/jQYLT/jQYLT.js @@ -138,7 +138,7 @@ exports.module = function(phantomas) { jQueryFunctions = jQueryFunctions.concat(jQueryTraversalFunctions); // spy calls to jQuery functions - phantomas.once('init', function() { + phantomas.on('init', function() { phantomas.evaluate(function(jQueryFunctions, jQueryTraversalFunctions) { (function(phantomas) { var oldJQuery; diff --git a/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js b/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js index b1b06ce..61489af 100644 --- a/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js @@ -23,7 +23,7 @@ exports.module = function(phantomas) { phantomas.log('javaScriptBottlenecks: to spy calls to eval() run phantomas with --spy-eval option'); } - phantomas.once('init', function() { + phantomas.on('init', function() { phantomas.evaluate(function(spyEval) { (function(phantomas) { function report(msg, caller, backtrace, metric) {