js/src/tests/js1_5/Regress/regress-233483-2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_5/Regress/regress-233483-2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,65 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +//-----------------------------------------------------------------------------
    1.10 +var BUGNUMBER = 233483;
    1.11 +var summary = 'Don\'t crash with null properties - Browser only';
    1.12 +var actual = 'No Crash';
    1.13 +var expect = 'No Crash';
    1.14 +
    1.15 +printBugNumber(BUGNUMBER);
    1.16 +printStatus (summary);
    1.17 +
    1.18 +if (typeof document == 'undefined')
    1.19 +{
    1.20 +  reportCompare(expect, actual, summary);
    1.21 +}
    1.22 +else
    1.23 +{ 
    1.24 +  // delay test driver end
    1.25 +  gDelayTestDriverEnd = true;
    1.26 +
    1.27 +  actual = 'Crash';
    1.28 +  window.onload = onLoad;
    1.29 +}
    1.30 +
    1.31 +function onLoad()
    1.32 +{
    1.33 +  var a = new Array();
    1.34 +  var pe;
    1.35 +  var x;
    1.36 +  var s;
    1.37 +
    1.38 +  setform();
    1.39 +
    1.40 +  for (pe=document.getElementById("test"); pe; pe=pe.parentNode)
    1.41 +  {
    1.42 +    a[a.length] = pe;
    1.43 +  }
    1.44 +
    1.45 +  // can't document.write since this is in after load fires
    1.46 +  s = a.toString();
    1.47 +
    1.48 +  actual = 'No Crash';
    1.49 +
    1.50 +  reportCompare(expect, actual, summary);
    1.51 +
    1.52 +  gDelayTestDriverEnd = false;
    1.53 +  jsTestDriverEnd();
    1.54 +}
    1.55 +
    1.56 +function setform()
    1.57 +{
    1.58 +  var form  = document.body.appendChild(document.createElement('form'));
    1.59 +  var table = form.appendChild(document.createElement('table'));
    1.60 +  var tbody = table.appendChild(document.createElement('tbody'));
    1.61 +  var tr    = tbody.appendChild(document.createElement('tr'));
    1.62 +  var td    = tr.appendChild(document.createElement('td'))
    1.63 +    var input = td.appendChild(document.createElement('input'));
    1.64 +
    1.65 +  input.setAttribute('id', 'test');
    1.66 +  input.setAttribute('value', '1232');
    1.67 +
    1.68 +}

mercurial