Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-367121.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-367121.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 367121;
9 var summary = 'self modifying script detection';
10 var actual = 'No Crash';
11 var expect = 'No Crash';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 if (typeof window == 'undefined')
25 {
26 actual = expect = 'Test skipped - Test must be run in the browser.';
27 reportCompare(expect, actual, summary);
28 }
29 else if (typeof Script == 'undefined')
30 {
31 actual = expect = 'Test skipped - Test requires Script object..';
32 reportCompare(expect, actual, summary);
33 }
34 else
35 {
36 gDelayTestDriverEnd = true;
37 }
38
39 exitFunc ('test');
40 }
41
42 function handleLoad()
43 {
44 var iframe = document.body.appendChild(document.createElement('iframe'));
45 var d = iframe.contentDocument;
46
47 d.addEventListener("test", function(e) {
48 s.compile("");
49 Array(11).join(Array(11).join(Array(101).join("aaaaa")));
50 }, true);
51
52 var e = d.createEvent("Events");
53 e.initEvent("test", true, true);
54 var s = new Script("d.dispatchEvent(e);");
55 s.exec();
56
57 gDelayTestDriverEnd = false;
58 reportCompare(expect, actual, summary);
59 jsTestDriverEnd();
60 }
61
62 if (typeof window != 'undefined')
63 {
64 window.onload = handleLoad;
65 }