* Instead of delete window.foobar whitelist the global in QUnit.config.pollution
** the reason either is needed is to make QUnit's "noglobal" option useful)
** delete window.foo throws an "TypeError: Object doesn't support this action" in Internet Explorer.
-> http://perfectionkills.com/understanding-delete/
* Remove other globals introduced
* Gets a message object, similar to wfMessage()
*
* @param key string Key of message to get
- * @param parameters mixed First argument in a list of variadic arguments,
+ * @param parameter_1 mixed First argument in a list of variadic arguments,
* each a parameter for $N replacement in messages.
* @return Message
*/
this.message = function( key, parameter_1 /* [, parameter_2] */ ) {
+ var parameters;
// Support variadic arguments
if ( parameter_1 !== undefined ) {
parameters = $.makeArray( arguments );
test( 'addCSS', function(){
expect(3);
- window.a = mw.util.addCSS( '#bodyContent { visibility: hidden; }' );
+ var a = mw.util.addCSS( '#bodyContent { visibility: hidden; }' );
ok( a, 'function works' );
deepEqual( a.disabled, false, 'property "disabled" is available and set to false' );
deepEqual( 'anotherGlobalMapChecker' in window, true, 'new mw.Map( true ) did store its values in the global window object' );
ok( window.anotherGlobalMapChecker, 'new mw.Map( true ) did store its values in the global window object' );
- // Clean up
- delete window.anotherGlobalMapChecker;
+ // Whitelist this global variable for QUnit 'noglobal' mode
+ QUnit.config.pollution.push( 'anotherGlobalMapChecker' );
});
test( 'mw.config', function(){
deepEqual( goodbye.exists(), false, 'Message.exists() returns false for inexisting messages' );
equal( goodbye.toString(), '<goodbye>', 'Message.toString() returns <key> if key does not exist' );
+
});
test( 'mw.msg', function(){