From 5c651dbac8f1e48864a4c6f5658922e7e4e00e9c Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Mon, 25 Aug 2014 16:59:29 -0700 Subject: [PATCH] mediawiki.debug: Fix crash in browsers without Function#bind PhantomJS has a partial ECMAScript 5 implementation but it does not include Function.prototype.bind. Detect that and error gracefully instead of erroring out in the middle of a phantomjs qunit run. Change-Id: Ic06e08490e8f297fda479c4adaf9b2d8735f63ad --- resources/src/mediawiki/mediawiki.debug.profile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/src/mediawiki/mediawiki.debug.profile.js b/resources/src/mediawiki/mediawiki.debug.profile.js index 64ec6c394a..b4d57732eb 100644 --- a/resources/src/mediawiki/mediawiki.debug.profile.js +++ b/resources/src/mediawiki/mediawiki.debug.profile.js @@ -70,10 +70,10 @@ * @param string tag to create * @return DOMElement */ - createSvgElement: document.createElementNS + createSvgElement: ( document.createElementNS && Function.prototype.bind ) ? document.createElementNS.bind( document, 'http://www.w3.org/2000/svg' ) // throw a error for browsers which does not support document.createElementNS (IE<8) - : function () { throw new Error( 'document.createElementNS not supported' ); }, + : function () { throw new Error( 'An ES5 compatible javascript engine is required for the profile visualization.' ); }, /** * @param DOMElement|undefined -- 2.20.1