Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-321757.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-321757.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 321757;
9 var summary = 'Compound assignment operators should not bind LHS';
10 var actual = '';
11 var expect = 'pass';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 try
17 {
18 foo += 1;
19 actual = "fail";
20 }
21 catch (e)
22 {
23 actual = "pass";
24 }
25
26 reportCompare(expect, actual, summary + ': +=');
27
28 try
29 {
30 foo -= 1;
31 actual = "fail";
32 }
33 catch (e)
34 {
35 actual = "pass";
36 }
37
38 reportCompare(expect, actual, summary + ': -=');
39
40 try
41 {
42 foo *= 1;
43 actual = "fail";
44 }
45 catch (e)
46 {
47 actual = "pass";
48 }
49
50 reportCompare(expect, actual, summary + ': *=');
51
52 try
53 {
54 foo /= 1;
55 actual = "fail";
56 }
57 catch (e)
58 {
59 actual = "pass";
60 }
61
62 reportCompare(expect, actual, summary + ': /=');
63
64 try
65 {
66 foo %= 1;
67 actual = "fail";
68 }
69 catch (e)
70 {
71 actual = "pass";
72 }
73
74 reportCompare(expect, actual, summary + ': %=');
75
76 try
77 {
78 foo <<= 1;
79 actual = "fail";
80 }
81 catch (e)
82 {
83 actual = "pass";
84 }
85
86 reportCompare(expect, actual, summary + ': <<=');
87
88 try
89 {
90 foo >>= 1;
91 actual = "fail";
92 }
93 catch (e)
94 {
95 actual = "pass";
96 }
97
98 reportCompare(expect, actual, summary + ': >>=');
99
100 try
101 {
102 foo >>>= 1;
103 actual = "fail";
104 }
105 catch (e)
106 {
107 actual = "pass";
108 }
109
110 reportCompare(expect, actual, summary + ': >>>=');