Sitelet https://github.com/angular/angular/issues/70252
Skip to content

Symbol.iterator in FieldTree is always false #70252

Description

@urugator

Which @angular/* package(s) are the source of the bug?

forms

Is this a regression?

No

Description

I want to traverse a FieldTree<unknown>. A typesafe check for iterability requires checking for presence of Symbol.iterator field:

if (Symbol.iterator in fieldTree && typeof fieldTree[Symbol.iterator] === 'function') {
  for (const [k, v] of fieldTree) {
      // ...
  }
}

However the field proxy doesn't implement has handler, therefore Symbol.iterator is reported as missing, even though it's returned by get handler:

if (property === Symbol.iterator) {

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

"@angular/forms": "^22.1.0",

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions