Debian Codegraph @

rhino/testsrc/tests/js1_5/LexicalConventions/regress-343675.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-343675.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 343675;
9 var summary = 'Allow keywords, reserved words as function names';
10 var actual = '';
11 var expect = 'No Error';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 var words = [
25 'break', 'else', 'new', 'var', 'case', 'finally', 'return', 'void',
26 'catch', 'for', 'switch', 'while', 'continue', 'function', 'this',
27 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'do',
28 'instanceof', 'typeof',
29 'abstract', 'enum', 'int', 'short', 'boolean', 'export', 'interface',
30 'static', 'byte', 'extends', 'long', 'super', 'char', 'final', 'native',
31 'synchronized', 'class', 'float', 'package', 'throws', 'const', 'goto',
32 'private', 'transient', 'debugger', 'implements', 'protected', 'volatile',
33 'double', 'import', 'public'];
34
35 for (var i = 0; i < words.length; i++)
36 {
37 try
38 {
39 actual = 'No Error';
40 eval('function ' + words[i] + '() {}');
41 }
42 catch(ex)
43 {
44 actual = ex + '';
45 }
46 reportCompare(expect, actual, summary + ': ' + words[i]);
47 }
48
49 exitFunc ('test');
50 }