« Bugzilla Issues Index
#4531 — 9.1.11: informative [[Enumerate]] algorithm bugs
- bug_id:
4531
- creation_ts:
2015-08-26 12:33:00 -0700
- short_desc:
9.1.11: informative [[Enumerate]] algorithm bugs
- delta_ts:
2015-08-26 12:33:07 -0700
- product:
ECMA-262 Edition 6
- component:
technical issues
- version:
unspecified
- rep_platform:
All
- op_sys:
All
- bug_status:
CONFIRMED
- priority:
Normal
- bug_severity:
normal
- everconfirmed:
true
- reporter:
Allen Wirfs-Brock
- assigned_to:
Allen Wirfs-Brock
- commentid:
14692
- comment_count:
0
- who:
Allen Wirfs-Brock
- bug_when:
2015-08-26 12:33:07 -0700
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;
}