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 ) {