GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(animations): replace copy of query selector node-list from "sprea… · angular/angular@e95cd2a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/animations/browser/src/render
    • shared.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/animations/browser/src/render/shared.ts‎

Copy file name to clipboardExpand all lines: packages/animations/browser/src/render/shared.ts
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,17 @@ if (_isNode || typeof Element !== 'undefined') {
183183
_query = (element: any, selector: string, multi: boolean): any[] => {
184184
let results: any[] = [];
185185
if (multi) {
186-
results.push(...element.querySelectorAll(selector));
186+
// DO NOT REFACTOR TO USE SPREAD SYNTAX.
187+
// For element queries that return sufficiently large NodeList objects,
188+
// using spread syntax to populate the results array causes a RangeError
189+
// due to the call stack limit being reached. `Array.from` can not be used
190+
// as well, since NodeList is not iterable in IE 11, see
191+
// https://developer.mozilla.org/en-US/docs/Web/API/NodeList
192+
// More info is available in #38551.
193+
const elems = element.querySelectorAll(selector);
194+
for (let i = 0; i < elems.length; i++) {
195+
results.push(elems[i]);
196+
}
187197
} else {
188198
const elm = element.querySelector(selector);
189199
if (elm) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.