You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A #private read inside a *[Symbol.iterator]() generator method throws "Cannot access private member" (next redis@6.1.0 blocker after #11150) #11170
Inside a generator method whose key is a well-known symbol (*[Symbol.iterator](), *[Symbol.hasInstance]()), the receiver is lost. A #private read throws TypeError: Cannot access private member from an object whose class did not declare it. For *[Symbol.hasInstance](), calling the method returns undefined instead of a generator object. These keys work: string keys, const string keys, literal computed keys, and non-generator symbol-keyed methods.
This is the next redis@6.1.0 blocker after #11150. @redis/client's DoublyLinkedList / SinglyLinkedList (dist/lib/client/linked-list.js) define *[Symbol.iterator]() { let node = this.#head; ... }. RedisCommandsQueue iterates them with for (const node of this.#waitingForReply) / for (const node of this.#toWrite). So with #11150 fixed, createClient({ socket }) connects, gets its HELLO reply and emits connect / ready. The first command then rejects with this TypeError (trace: at new EmptyAwareSinglyLinkedList).
plain 3
sym direct 3
sym spread 3
const key 3
literal key 3
sym non-gen 3
sym this object
Perry, compiled from origin/main e6a3bd8f5 with the #11150 fix and #11137 merged in (perry-dev build, PERRY_NO_AUTO_OPTIMIZE=1, Linux x86_64). The same throw for [...g] (the sym spread case) also reproduces on plain main 2754cb0fa, without either change.
plain 3
sym direct threw Cannot access private member from an object whose class did not declare it
sym spread threw Cannot access private member from an object whose class did not declare it
const key 3
literal key 3
sym non-gen 3
sym this threw Cannot read properties of undefined (reading 'next')
Related (closed): #10445 (this === undefined inside *[Symbol.iterator]() when calling this.method()), #10839, #5128. This looks like the same family on the private-brand path. The this / receiver binding of a well-known-symbol-keyed generator method differs from every other method-key form.
Activity
fix(runtime): resolve static well-known-symbol computed methods; trim…
fix(hir,runtime): keep the receiver of well-known-symbol-keyed genera…
fix(runtime): resolve static well-known-symbol computed methods; trim…
test: note #11170 on the #5128 iterator regression test
fix(hir,runtime): keep the receiver of well-known-symbol-keyed genera…
fix(runtime): resolve static well-known-symbol computed methods; trim…
test: note #11170 on the #5128 iterator regression test