Bug 1921963 part 1 - Use JS::ReportUncatchableException more outside the JS engine...
[gecko.git] / js / src / tests / non262 / regress / regress-233483-2.js
blob8b6f728af3af3cde8fdf42c3ce4e2c0a3963320a
1 // |reftest| skip-if(xulRuntime.shell)
2 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 233483;
9 var summary = 'Don\'t crash with null properties - Browser only';
10 var actual = 'No Crash';
11 var expect = 'No Crash';
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
16 // delay test driver end
17 gDelayTestDriverEnd = true;
19 actual = 'Crash';
20 window.onload = onLoad;
22 function onLoad()
24   var a = new Array();
25   var pe;
26   var x;
27   var s;
29   setform();
31   for (pe=document.getElementById("test"); pe; pe=pe.parentNode)
32   {
33     a[a.length] = pe;
34   }
36   // can't document.write since this is in after load fires
37   s = a.toString();
39   actual = 'No Crash';
41   reportCompare(expect, actual, summary);
43   gDelayTestDriverEnd = false;
44   jsTestDriverEnd();
47 function setform()
49   var form  = document.body.appendChild(document.createElement('form'));
50   var table = form.appendChild(document.createElement('table'));
51   var tbody = table.appendChild(document.createElement('tbody'));
52   var tr    = tbody.appendChild(document.createElement('tr'));
53   var td    = tr.appendChild(document.createElement('td'))
54     var input = td.appendChild(document.createElement('input'));
56   input.setAttribute('id', 'test');
57   input.setAttribute('value', '1232');