package goja import "testing" func TestSetEvilIterator(t *testing.T) { const SCRIPT = ` var o = {}; o[Symbol.iterator] = function() { return { next: function() { if (!this.flag) { this.flag = true; return {}; } return {done: true}; } } } new Set(o); undefined; ` testScript1(SCRIPT, _undefined, t) }