Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-381304.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-381304.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 381304;
9 var summary = 'getter/setter with keywords';
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 var obj;
25
26 print('1');
27
28 obj = {
29 set inn(value) {this.for = value;},
30 get inn() {return this.for;}
31 };
32
33 expect = '({get inn() {return this.for;}, set inn(value) {this.for = value;}})';
34 actual = obj.toSource();
35 compareSource(expect, actual, summary + ': 1');
36
37 print('2');
38
39 obj = {
40 set in(value) {this.for = value;},
41 get in() {return this.for;}
42 };
43
44 expect = '( { in getter : ( function ( ) { return this . for ; } ) , in setter : ( function ( value ) { this . for = value ; } ) } )';
45 actual = obj.toSource();
46 compareSource(expect, actual, summary + ': 2');
47
48 print('3');
49
50 obj = {
51 get in(value) {this.for = value;},
52 set in() {return this.for;}
53 };
54
55 expect = '( { in getter : ( function ( value ) { this . for = value ; } ) , in setter : ( function ( ) { return this . for ; } ) } ) ';
56 actual = obj.toSource();
57 compareSource(expect, actual, summary + ': 3');
58
59 print('4');
60
61 obj = {
62 set inn(value) {this.for = value;},
63 get in() {return this.for;}
64 };
65
66 expect = '( { set inn ( value ) { this . for = value ; } , in getter : ( function ( ) { return this . for ; } ) } )';
67 actual = obj.toSource();
68 compareSource(expect, actual, summary + ': 4');
69
70 print('5');
71
72 obj = {
73 set in(value) {this.for = value;},
74 get inn() {return this.for;}
75 };
76
77 expect = ' ( { in setter : ( function ( value ) { this . for = value ; } ) , get inn ( ) { return this . for ; } } ) ';
78 actual = obj.toSource();
79 compareSource(expect, actual, summary + ': 5');
80 exitFunc ('test');
81 }