Debian Codegraph @

rhino/testsrc/tests/js1_8/extensions/regress-385729.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-385729.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 385729;
9 var summary = 'uneval(eval(expression closure))';
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 if (typeof eval != 'undefined' && typeof uneval != 'undefined')
25 {
26 expect = '(function f () /x/g)';
27 try
28 {
29 // mozilla 1.9
30 actual = uneval(eval(expect));
31 }
32 catch(ex)
33 {
34 // mozilla 1.8
35 expect = 'SyntaxError: missing { before function body';
36 actual = ex + '';
37 }
38 compareSource(expect, actual, summary);
39
40 expect = '({get f () /x/g})';
41 try
42 {
43 // mozilla 1.9
44 actual = uneval(eval("({get f () /x/g})"));
45 }
46 catch(ex)
47 {
48 // mozilla 1.8
49 expect = 'SyntaxError: missing { before function body';
50 actual = ex + '';
51 }
52 compareSource(expect, actual, summary);
53 }
54
55 exitFunc ('test');
56 }