Debian Codegraph @

rhino/testsrc/tests/js1_7/block/regress-352616.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-352616.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 352616;
9 var summary = 'Do not Crash reporting error with |for..in| and |let|';
10 var actual = 'No Crash';
11 var expect = 'No Crash';
12
13 //-----------------------------------------------------------------------------
14 test();
15 //-----------------------------------------------------------------------------
16
17 function test()
18 {
19 enterFunc ('test');
20 printBugNumber(BUGNUMBER);
21 printStatus (summary);
22
23 expect = /TypeError: (\(let \(b = 1\) 2\).c is not a function|Cannot find function c.)/;
24 actual = 'No Error';
25 try
26 {
27 for(a in (let (b=1) 2).c(3)) { };
28 }
29 catch(ex)
30 {
31 actual = ex + '';
32 }
33
34 reportMatch(expect, actual, summary + ': 1');
35
36 expect = /TypeError: (\(let \(b = 1, d = 2\) 2\).c is not a function|Cannot find function c.)/;
37 actual = 'No Error';
38 try
39 {
40 for(a in (let (b=1,d=2) 2).c(3)) { };
41 }
42 catch(ex)
43 {
44 actual = ex + '';
45 }
46
47 reportMatch(expect, actual, summary + ': 2');
48
49 expect = /TypeError: (\(let \(b = 1, d = 2\) 2\).c is not a function|Cannot find function c.)/;
50 actual = 'No Error';
51 try
52 {
53 for(a in (let (b=1,d=2) 2).c(3)) { };
54 }
55 catch(ex)
56 {
57 actual = ex + '';
58 }
59
60 reportMatch(expect, actual, summary + ': 3');
61
62 exitFunc ('test');
63 }