Skip to content

Commit 69719e8

Browse files
committed
Try converting NodeList to array for Safari 9
1 parent 6d4dab3 commit 69719e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function highlight(root, activeNode, nodes)
247247
{
248248
resetHighlightedNodes(root);
249249
250-
(nodes||[]).forEach(function (node) {
250+
Array.from(nodes||[]).forEach(function (node) {
251251
if (!/\bsf-dump-highlight\b/.test(node.className)) {
252252
node.className = node.className + ' sf-dump-highlight';
253253
}
@@ -260,7 +260,7 @@ function highlight(root, activeNode, nodes)
260260
261261
function resetHighlightedNodes(root)
262262
{
263-
root.querySelectorAll('.sf-dump-str, .sf-dump-key, .sf-dump-public, .sf-dump-protected, .sf-dump-private').forEach(function (strNode) {
263+
Array.from(root.querySelectorAll('.sf-dump-str, .sf-dump-key, .sf-dump-public, .sf-dump-protected, .sf-dump-private')).forEach(function (strNode) {
264264
strNode.className = strNode.className.replace(/\b sf-dump-highlight\b/, '');
265265
strNode.className = strNode.className.replace(/\b sf-dump-highlight-active\b/, '');
266266
});
@@ -456,7 +456,7 @@ function isCtrlKey(e) {
456456
counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' on ' + state.count();
457457
}, 400);
458458
});
459-
search.querySelectorAll('.sf-dump-search-input-next, .sf-dump-search-input-previous').forEach(function (btn) {
459+
Array.from(search.querySelectorAll('.sf-dump-search-input-next, .sf-dump-search-input-previous')).forEach(function (btn) {
460460
addEventListener(btn, 'click', function (e) {
461461
e.preventDefault();
462462
var direction = -1 !== e.target.className.indexOf('next') ? 'next' : 'previous';

0 commit comments

Comments
 (0)