@@ -20,15 +20,15 @@ export default function(internals) {
2020 */
2121 Node . prototype . insertBefore = function ( node , refNode ) {
2222 if ( node instanceof DocumentFragment ) {
23- const insertedNodes = [ ... node . childNodes ] ;
23+ const insertedNodes = Array . prototype . slice . apply ( node . childNodes ) ;
2424 const nativeResult = BuiltIn . Node_insertBefore . call ( this , node , refNode ) ;
2525
2626 // DocumentFragments can't be connected, so `disconnectTree` will never
2727 // need to be called on a DocumentFragment's children after inserting it.
2828
2929 if ( Utilities . isConnected ( this ) ) {
30- for ( const node of insertedNodes ) {
31- internals . connectTree ( node ) ;
30+ for ( let i = 0 ; i < insertedNodes . length ; i ++ ) {
31+ internals . connectTree ( insertedNodes [ i ] ) ;
3232 }
3333 }
3434
@@ -56,15 +56,15 @@ export default function(internals) {
5656 */
5757 Node . prototype . appendChild = function ( node ) {
5858 if ( node instanceof DocumentFragment ) {
59- const insertedNodes = [ ... node . childNodes ] ;
59+ const insertedNodes = Array . prototype . slice . apply ( node . childNodes ) ;
6060 const nativeResult = BuiltIn . Node_appendChild . call ( this , node ) ;
6161
6262 // DocumentFragments can't be connected, so `disconnectTree` will never
6363 // need to be called on a DocumentFragment's children after inserting it.
6464
6565 if ( Utilities . isConnected ( this ) ) {
66- for ( const node of insertedNodes ) {
67- internals . connectTree ( node ) ;
66+ for ( let i = 0 ; i < insertedNodes . length ; i ++ ) {
67+ internals . connectTree ( insertedNodes [ i ] ) ;
6868 }
6969 }
7070
@@ -120,16 +120,16 @@ export default function(internals) {
120120 */
121121 Node . prototype . replaceChild = function ( nodeToInsert , nodeToRemove ) {
122122 if ( nodeToInsert instanceof DocumentFragment ) {
123- const insertedNodes = [ ... nodeToInsert . childNodes ] ;
123+ const insertedNodes = Array . prototype . slice . apply ( nodeToInsert . childNodes ) ;
124124 const nativeResult = BuiltIn . Node_replaceChild . call ( this , nodeToInsert , nodeToRemove ) ;
125125
126126 // DocumentFragments can't be connected, so `disconnectTree` will never
127127 // need to be called on a DocumentFragment's children after inserting it.
128128
129129 if ( Utilities . isConnected ( this ) ) {
130130 internals . disconnectTree ( nodeToRemove ) ;
131- for ( const node of insertedNodes ) {
132- internals . connectTree ( node ) ;
131+ for ( let i = 0 ; i < insertedNodes . length ; i ++ ) {
132+ internals . connectTree ( insertedNodes [ i ] ) ;
133133 }
134134 }
135135
0 commit comments