Debian Codegraph @

js/src/tests/non262/regress/regress-1707974.js

raw
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/. */
5
6 const BUGNUMBER = 1707974;
7 const SUMMARY = "Test mismatched placement error";
8
9 printBugNumber(BUGNUMBER);
10 printStatus(SUMMARY);
11
12 let actual = "";
13 const expect = "SyntaxError: getter and setter for private name #x \
14 should either be both static or non-static";
15
16 try
17 {
18 eval(`
19 class A {
20 static set #x(_) {}
21 get #x() {}
22 }
23 `);
24 }
25 catch(ex)
26 {
27 actual = ex + "";
28 }
29
30 reportCompare(expect, actual, SUMMARY);