From 69b49c15a21974d6883c07af6a09969f99a91785 Mon Sep 17 00:00:00 2001 From: Ryan McCahan Date: Wed, 2 Oct 2024 03:17:29 -0600 Subject: [PATCH] Use Array.values() for iteration (#1682) Prevent issues when the user has added a function to the Array prototype --- src/Resources/queries/widget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resources/queries/widget.js b/src/Resources/queries/widget.js index ad1f1469..61b43a05 100644 --- a/src/Resources/queries/widget.js +++ b/src/Resources/queries/widget.js @@ -334,7 +334,7 @@ const $li = $('
  • ').addClass(csscls('table-list-item')); const $muted = $('').addClass(css('text-muted')); - for (const i in values) { + for (const i in values.values()) { if (showLineNumbers) { $ul.append($li.clone().append([$muted.clone().text(`${i}:`), ' ', $('').text(values[i])])); } else { @@ -353,7 +353,7 @@ const $muted = $('').addClass(css('text-muted')); const values = []; - for (const trace of traces) { + for (const trace of traces.values()) { const $span = $('').text(trace.name || trace.file); if (trace.namespace) { $span.prepend(`${trace.namespace}::`);