Bug 1921963 part 1 - Use JS::ReportUncatchableException more outside the JS engine...
[gecko.git] / js / src / tests / non262 / regress / regress-321757.js
blob268d737cfc9e17f00212abf139f4945eefd0fc37
1 /* -*- indent-tabs-mode: nil; js-indent-level: 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/. */
6 //-----------------------------------------------------------------------------
7 var BUGNUMBER = 321757;
8 var summary = 'Compound assignment operators should not bind LHS';
9 var actual = '';
10 var expect = 'pass';
12 printBugNumber(BUGNUMBER);
13 printStatus (summary);
15 try
17   foo += 1;
18   actual = "fail";
20 catch (e)
22   actual = "pass";
25 reportCompare(expect, actual, summary + ': +=');
27 try
29   foo -= 1;
30   actual = "fail";
32 catch (e)
34   actual = "pass";
37 reportCompare(expect, actual, summary + ': -=');
39 try
41   foo *= 1;
42   actual = "fail";
44 catch (e)
46   actual = "pass";
49 reportCompare(expect, actual, summary + ': *=');
51 try
53   foo /= 1;
54   actual = "fail";
56 catch (e)
58   actual = "pass";
61 reportCompare(expect, actual, summary + ': /=');
63 try
65   foo %= 1;
66   actual = "fail";
68 catch (e)
70   actual = "pass";
73 reportCompare(expect, actual, summary + ': %=');
75 try
77   foo <<= 1;
78   actual = "fail";
80 catch (e)
82   actual = "pass";
85 reportCompare(expect, actual, summary + ': <<=');
87 try
89   foo >>= 1;
90   actual = "fail";
92 catch (e)
94   actual = "pass";
97 reportCompare(expect, actual, summary + ': >>=');
99 try
101   foo >>>= 1;
102   actual = "fail";
104 catch (e)
106   actual = "pass";
109 reportCompare(expect, actual, summary + ': >>>=');