Source code
Revision control
Copy as Markdown
Other Tools
/* Any copyright is dedicated to the Public Domain.
let length;
let iterable = {
[Symbol.iterator]() { return this; },
next() { length = arguments.length; return {done: true}; }
};
new Map(iterable);
assertEq(length, 0);
let typeofThis;
Object.defineProperty(Number.prototype, Symbol.iterator, {
value() {
"use strict";
typeofThis = typeof this;
return { next() { return {done: true}; } };
}
});
new Map(0);
assertEq(typeofThis, "number");
if (typeof reportCompare === "function")
reportCompare(0, 0);