Use Array#push instead of Array#concat

Change-Id: I605e726fce1cf1acf39ffdcfe8c7cd51c032a372
This commit is contained in:
Ed Sanders 2024-05-24 13:53:04 +01:00 committed by Bartosz Dziewoński
parent ea5639b20b
commit 177639f5be
2 changed files with 14 additions and 12 deletions

View file

@ -251,22 +251,24 @@ function getCheckboxesPromise( pageName, oldId ) {
* @return {string[]}
*/
function getReplyWidgetModules() {
const veConf = mw.config.get( 'wgVisualEditorConfig' );
let modules = [ 'ext.discussionTools.ReplyWidget' ]
.concat( veConf.pluginModules.filter( mw.loader.getState ) );
const modules = [];
if ( OO.ui.isMobile() ) {
modules = [
modules.push(
'ext.visualEditor.core.mobile',
'ext.visualEditor.mwextensions'
].concat( modules );
);
} else {
modules = [
modules.push(
'ext.visualEditor.core.desktop',
'ext.visualEditor.desktopTarget',
'ext.visualEditor.mwextensions.desktop'
].concat( modules );
);
}
modules.push( 'ext.discussionTools.ReplyWidget' );
const veConf = mw.config.get( 'wgVisualEditorConfig' );
modules.push( ...veConf.pluginModules.filter( mw.loader.getState ) );
return modules;
}

View file

@ -11,7 +11,7 @@ require( './CommentTarget.js' );
* @param {Object} [config] Configuration options
*/
function CommentTargetWidget( replyWidget, config ) {
let excludeCommands = [
const excludeCommands = [
'blockquoteWrap', // T258194
// Disable to allow Tab/Shift+Tab to move focus out of the widget (T172694)
'indent',
@ -26,7 +26,7 @@ function CommentTargetWidget( replyWidget, config ) {
];
if ( !replyWidget.isNewTopic ) {
excludeCommands = excludeCommands.concat( [
excludeCommands.push(
// Disable commands for things whose wikitext markup doesn't work when indented
'heading1',
'heading2',
@ -37,10 +37,10 @@ function CommentTargetWidget( replyWidget, config ) {
'insertTable',
'transclusionFromSequence', // T253667
'preformatted'
] );
);
}
config = Object.assign( {}, {
config = Object.assign( {
excludeCommands: excludeCommands
}, config );