Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-327608.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-327608.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 327608;
9 var summary = 'Do not assume we will find the prototype property';
10 var actual = 'No Crash';
11 var expect = 'No Crash';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15 print('This test runs only in the browser');
16
17 function countProps(obj)
18 {
19 var c;
20 for (var prop in obj)
21 ++c;
22 return c;
23 }
24
25 function init()
26 {
27 var inp = document.getElementsByTagName("input")[0];
28 countProps(inp);
29 gc();
30 var blurfun = inp.blur;
31 blurfun.__proto__ = null;
32 countProps(blurfun);
33 reportCompare(expect, actual, summary);
34 gDelayTestDriverEnd = false;
35 jsTestDriverEnd();
36 }
37
38 if (typeof window != 'undefined')
39 {
40 // delay test driver end
41 gDelayTestDriverEnd = true;
42
43 document.write('<input>');
44 window.addEventListener("load", init, false);
45 }
46 else
47 {
48 reportCompare(expect, actual, summary);
49 }