d413fc27212c318feb8ce4f2862255338e1547ac
This is happening due to operator precedence. Taking a simpler example: return i || typeof i === 'function' ? i() : (i + 3); where i is 1 Explanation from ChatGPT: * First, the typeof operator is evaluated for i. Since i is 1, typeof i returns the string 'number'. The result of this operation is `'number'. * Then, the === operator is applied to 'number' and 'function'. The result is false because these two strings are not equal. * Now, we have the logical OR (||) operator. The i (which is 1) is compared to the result of the typeof and === operations combined, which is false. Since 1 is considered truthy, the || operation results in 1. * After the || operation, we have the conditional (ternary) operator ? :. In this case, the condition to the left of ? is 1, which is truthy, so the expression after ? is evaluated. * i() is the expression after ?. Since i is not a function, and the condition to the left is truthy, it attempts to call i() but throws a "TypeError: i is not a function" error. Fiddle that demonstrates the issue: https://jsfiddle.net/t2v1w6ae/2/ Bug: T347847 Change-Id: If5e8405141dfafd53c4495c91265545ec01acab3
== Universal Language Selector == The Universal Language Selector extension (ULS) provides a flexible way to configure and deliver language settings like interface language, fonts, and input methods (keyboard mappings). This will allow users to type text in different languages not directly supported by their keyboard, read content in a script for which fonts are not available locally, or customise the language in which menus are displayed. For more information see: https://www.mediawiki.org/wiki/Universal_Language_Selector == Copying == You may use any Project Milkshake product, including the Universal Language Selector, under the terms of either the MIT License or the GNU General Public License (GPL) Version 2 or later. See GPL-LICENSE and MIT-LICENSE for details. == Installation == For a very, very quick start add the following lines to LocalSettings.php of your MediaWiki setup: wfLoadExtension( 'UniversalLanguageSelector' ); By default, ULS will appear at personal toolbar position. If you want ULS at interlanguage position, add the following line: $wgULSPosition = 'interlanguage'; == Developers == The MediaWiki Universal Language Selector project uses jquery.uls: https://github.com/wikimedia/jquery.uls Its development is at Wikimedia Github account. Any fixes to lib/ should happen at Github. Follow the build instructions of jquery.uls to create jquery.uls.js. Bugs for the extension are handled in Phabricator: https://phabricator.wikimedia.org/tag/mediawiki-extensions-universallanguageselector/
Description
Languages
JavaScript
79.4%
HTML
11.9%
PHP
4.7%
Less
2.5%
CSS
1.4%
Other
0.1%