Debian Codegraph @

rhino/testsrc/tests/js1_7/extensions/regress-346773.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-346773.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 346773;
9 var summary = 'Do not crash compiling with misplaced brances in function';
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 try
25 {
26 var src =
27 ' var it = {foo:"5"};' +
28 ' it.__iterator__ =' +
29 ' function(valsOnly)' +
30 ' {' +
31 ' var gen =' +
32 ' function()' +
33 ' {' +
34 ' for (var i = 0; i < keys.length; i++)' +
35 ' {' +
36 ' if (valsOnly)' +
37 ' yield vals[i];' +
38 ' else' +
39 ' yield [keys[i], vals[i]];' +
40 ' }' +
41 ' return gen();' +
42 ' }' +
43 ' }';
44 eval(src);
45 }
46 catch(ex)
47 {
48 }
49
50 reportCompare(expect, actual, summary);
51
52 exitFunc ('test');
53 }