blob: d7373a471d364c9c923a854f11d1a0a0d485b635 [file] [log] [blame]
<p>This test that setting HTMLSelectElement.length is capped to 2,147,483,647, and you can't add additional Option elements too.</p>
<div id="console"></div>
<select id="theSelect"></select>
<script src="../../../resources/js-test.js"></script>
<script>
var sel = document.getElementById('theSelect');
shouldBe('sel.length', '0');
debug('Trying: - sel.length = 2147483648;');
sel.length = 2147483648;
shouldBe('sel.length', '0');
debug('Trying: - sel.add(new Option, 0);');
sel.add(new Option, 0);
shouldBe('sel.length', '1');
debug('Trying: - sel.length = 0;');
sel.length = 0;
shouldBe('sel.length', '0');
debug('Index setter:');
shouldBe('sel[2147483648] = new Option(); sel.length', '0');
shouldBe('sel.options[2147483648] = new Option(); sel.length', '0');
</script>