Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-380831.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-380831.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 380831;
9 var summary = 'uneval trying to output a getter function that is a sharp definition';
10 var actual = '';
11 var expect = '';
12
13 //-----------------------------------------------------------------------------
14 test();
15 //-----------------------------------------------------------------------------
16
17 function test()
18 {
19 enterFunc ('test');
20 printBugNumber(BUGNUMBER);
21 printStatus (summary);
22
23 var f;
24
25 expect = '( { b getter : # 1 = ( function ( ) { } ) , c getter : # 1 # } )';
26 a = {};
27 f = function() { };
28 a.b getter = f;
29 a.c getter = f;
30 actual = uneval(a);
31 compareSource(expect, actual, summary);
32
33 expect = 'function ( ) { return { get x ( ) { } } ; }';
34 f = function() { return { x getter: function(){} } };
35 actual = f + '';
36 compareSource(expect, actual, summary);
37
38 expect = 'function ( ) { return { x getter : # 1 = function ( ) { } } ; }';
39 f = function() { return { x getter: #1=function(){} } };
40 actual = f + '';
41 compareSource(expect, actual, summary);
42
43 expect = 'function ( ) { return { x getter : # 1 # } ; }';
44 f = function() { return { x getter: #1# } };
45 actual = f + '';
46 compareSource(expect, actual, summary);
47
48 exitFunc ('test');
49 }