Debian Codegraph @

rhino/testsrc/tests/js1_7/regress/regress-410649.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-410649.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 410649;
9 var summary = 'function statement and destructuring parameter name clash';
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 function f(a) {
25 function a() { }
26 return a;
27 }
28
29 function g([a, b]) {
30 function a() { }
31 return a;
32 }
33
34 expect = 'function';
35 actual = typeof f(1);
36 reportCompare(expect, actual, "type for simple parameter case");
37
38 expect = 'function';
39 actual = typeof g([1, 2]);
40 reportCompare(expect, actual, "type for destructuring parameter case");
41
42 exitFunc ('test');
43 }