1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script src="../../js/resources/js-test-pre.js"></script> 5 </head> 6 <body> 7 <div id="test"> 8 <div id="console"></div> 9 </body> 10 <script> 11 window.jsTestIsAsync = true; 12 13 var form, input, str; 14 15 window.onload = function() 16 { 17 form = document.body.appendChild(document.createElement("form")); 18 form.id = "form"; 19 20 input = document.createElement("input"); 21 input.id = "input"; 22 input.setAttribute("form", "form"); 23 form.elements.namedItem("input"); 24 25 input = null; 26 27 gc(); 28 setTimeout(step2, 100); 29 } 30 31 function step2() 32 { 33 try { 34 str = typeof form['input'].form; 35 } catch(e) { 36 str = 'threw exception'; 37 } 38 shouldBe("str", "'threw exception'"); 39 finishJSTest(); 40 } 41 42 window.successfullyParsed = true; 43 </script> 44 <script src="../../js/resources/js-test-post.js"></script> 45 </html> 46