I ran into a confusing problem in SimonAlling/better-sweclockers#264. Consider an operation with this implementation:
export default (e: {
foo: HTMLElement,
bar: HTMLElement,
baz: HTMLElement,
}) => {
for (const element of Object.values(e)) {
console.log(element);
}
};
One would expect that all three elements would be logged, but this operation actually does nothing at all. The reason is that the properties of e aren't enumerable, so Object.values(e) is an empty array.
While it's easy to come up with pathological examples of operations that will be broken by this change, it should be backward compatible for all practical intents and purposes.
I ran into a confusing problem in SimonAlling/better-sweclockers#264. Consider an operation with this implementation:
One would expect that all three elements would be logged, but this operation actually does nothing at all. The reason is that the properties of
e
aren't enumerable, soObject.values(e)
is an empty array.While it's easy to come up with pathological examples of operations that will be broken by this change, it should be backward compatible for all practical intents and purposes.
💡
git show --color-words=.