Debian Codegraph @

rhino/testsrc/tests/js1_7/iterable/regress-415922.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-415922.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 415922;
9 var summary = 'Support exception from withing JSNewEnumerateOp on JSENUMERATE_NEXT';
10 var actual = 'No Error';
11 var expect = 'Error: its enumeration failed';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 function f() { for (k in it) return k }
25
26 if (typeof it == 'undefined')
27 {
28 print(expect = actual = 'it not defined, test skipped');
29 }
30 else
31 {
32 try
33 {
34 it.enum_fail = true;
35 var r = f();
36 actual = 'No exception r: ' + r.toString();
37 }
38 catch (e)
39 {
40 actual = e + '';
41 }
42 finally
43 {
44 it.enum_fail = false;
45 }
46 }
47 reportCompare(expect, actual, summary);
48
49 exitFunc ('test');
50 }