From: Bartosz DziewoƄski Date: Fri, 27 Dec 2013 22:03:13 +0000 (+0100) Subject: mw.loader.store: Detect malformed function stringification X-Git-Tag: 1.31.0-rc.0~17483 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=3d047807f60306c45c22ded42daeb3c316249c6e;p=lhc%2Fweb%2Fwiklou.git mw.loader.store: Detect malformed function stringification See the bug for details. This seems to happen somewhat consistently on Opera 12, let's try to work around the browser bug before we blacklist it. Includes some console logging. Bug: 57567 Change-Id: Ifd7b203fb0ca61e4a749e6b0fc031e62121cc45a --- diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index 89da4a2ee7..f3bb414703 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -1960,6 +1960,12 @@ var mw = ( function ( $, undefined ) { JSON.stringify( descriptor.style ), JSON.stringify( descriptor.messages ) ]; + // Attempted workaround for a possible Opera bug (bug 57567). + // This regex should never match under sane conditions. + if ( /^\s*\(/.test( args[1] ) ) { + args[1] = 'function' + args[1]; + log( 'Detected malformed function stringification (bug 57567)' ); + } } catch ( e ) { return; }