3 ms·
> also goes through the prototype methods after the > elements. That shouldn't be happening. If you see it happening, your JS implementation is just buggy
by bzbarsky 15y ago
> also goes through the prototype methods after the
> elements.
That shouldn't be happening. If you see it happening, your JS implementation is just buggy.
In fact, this testcase:
<script>
window.onload = function() {
var arr = window[0].arr;
for (var i in arr) { alert(i); }
}
</script>
<iframe src="data:text/html,<script>arr=[1];</script>">
</iframe>
alerts only "0" in WebKit+JSC, Gecko, Presto. Chrome has some sort of bizarre security policy here that keeps the script from working, so no idea what WebKit+V8 does.