Merge "MWCitationDialog: Use const instead of let"

This commit is contained in:
jenkins-bot 2024-06-05 10:10:16 +00:00 committed by Gerrit Code Review
commit e3dbe7dd3a

View file

@ -55,22 +55,21 @@ ve.ui.MWCitationDialog.prototype.getReferenceNode = function () {
ve.ui.MWCitationDialog.prototype.getSelectedNode = function () { ve.ui.MWCitationDialog.prototype.getSelectedNode = function () {
const referenceNode = this.getReferenceNode(); const referenceNode = this.getReferenceNode();
let transclusionNode;
if ( referenceNode ) { if ( referenceNode ) {
const branches = referenceNode.getInternalItem().getChildren(); const branches = referenceNode.getInternalItem().getChildren();
const leaves = branches && const leaves = branches &&
branches.length === 1 && branches.length === 1 &&
branches[ 0 ].canContainContent() && branches[ 0 ].canContainContent() &&
branches[ 0 ].getChildren(); branches[ 0 ].getChildren();
transclusionNode = leaves && const transclusionNode = leaves &&
leaves.length === 1 && leaves.length === 1 &&
leaves[ 0 ] instanceof ve.dm.MWTransclusionNode && leaves[ 0 ] instanceof ve.dm.MWTransclusionNode &&
leaves[ 0 ]; leaves[ 0 ];
}
// Only use the selected node if it is the same template as this dialog expects // Only use the selected node if it is the same template as this dialog expects
if ( transclusionNode && transclusionNode.isSingleTemplate( this.citationTemplate ) ) { if ( transclusionNode && transclusionNode.isSingleTemplate( this.citationTemplate ) ) {
return transclusionNode; return transclusionNode;
}
} }
return null; return null;