From d62fc8b49a384ea487bf6d31758adfefc5d73e12 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Tue, 18 Aug 2020 23:17:03 +0100 Subject: [PATCH] Use Array.prototype.forEach.call in copyAttributes Change-Id: I6c890fecf6f6002d44b32f0c85a3193c0c2632e3 --- modules/ve-mw/preinit/ve.init.mw.ArticleTargetSaver.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/preinit/ve.init.mw.ArticleTargetSaver.js b/modules/ve-mw/preinit/ve.init.mw.ArticleTargetSaver.js index 74699ae188..38acacafd2 100644 --- a/modules/ve-mw/preinit/ve.init.mw.ArticleTargetSaver.js +++ b/modules/ve-mw/preinit/ve.init.mw.ArticleTargetSaver.js @@ -53,10 +53,9 @@ var i, len; function copyAttributes( from, to ) { - var i2, len2; - for ( i2 = 0, len2 = from.attributes.length; i2 < len2; i2++ ) { - to.setAttribute( from.attributes[ i2 ].name, from.attributes[ i2 ].value ); - } + Array.prototype.forEach.call( from.attributes, function ( attr ) { + to.setAttribute( attr.name, attr.value ); + } ); } if ( oldDoc ) {