This restores the behavior for undefined params as it was before
I445f9194bb8b2ed35baafbda30d1d0d008b64e2c
Bug: T207397
Change-Id: I751f01a9b3cd8bb87d7d7def98c918a87ddf81cd
!/\{\{|[<>[&]/.test( this.map.get( this.key ) ) &&
// jqueryMsg parser is needed when jQuery objects or DOM nodes are passed in as parameters
!this.parameters.some( function ( param ) {
- return param instanceof $ || param.nodeType !== undefined;
+ return param instanceof $ || ( param && param.nodeType !== undefined );
} )
)
) {
'Passing a DOM node as a parameter to a message without wikitext works correctly'
);
+ assert.strictEqual(
+ mw.message( 'param-test', undefined ).parse(),
+ 'Hello $1',
+ 'Passing undefined as a parameter to a message does not throw an exception'
+ );
+
assert.strictEqual(
mw.message(
'param-test-with-link',