archives

« Bugzilla Issues Index

#4531 — 9.1.11: informative [[Enumerate]] algorithm bugs


reported in https://esdiscuss.org/topic/is-the-informative-definition-of-enumerate-buggy

If the prototype of obj is a proxy or other exotic object it might return non-string keys or or duplicates or other things that violate the normative requirements stated in 9.1.11

to fix it, replace the last if statement of the enumerate generator function with:

if (!visited.has(protoName) && typeof protoName === "string") {
visited.add(protoName);
yield protoName;
}