Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-365692.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-365692.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 365692;
9 var summary = 'getter/setter bytecodes should support atoms over 64k';
10 var actual = 'No Crash';
11 var expect = 'No Crash';
12
13
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
16
17 function g()
18 {
19 return 10;
20 }
21
22 try
23 {
24 var N = 100*1000;
25 var src = 'var x = ["';
26 var array = Array(N);
27 for (var i = 0; i != N; ++i)
28 array[i] = i;
29 src += array.join('","')+'"]; x.a getter = g; return x.a;';
30 var f = Function(src);
31 if (f() != 10)
32 throw "Unexpected result";
33 }
34 catch(ex)
35 {
36 if (ex == "Unexpected result")
37 {
38 actual = ex;
39 }
40 }
41 reportCompare(expect, actual, summary);