summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/static-init-invalid-return.js
blob: 7ee3cbe89ba249d9877a1a4c5c26c1aa60c3f55a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// |reftest| error:SyntaxError
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-class-definitions
description: The "Return" parsing context does not apply to the block's statement list
info: |
  Syntax

  [...]

  ClassStaticBlockStatementList :
     StatementList[~Yield, +Await, ~Return]opt
negative:
  phase: parse
  type: SyntaxError
features: [class-static-block]
---*/

$DONOTEVALUATE();

function f() {
  class C {
    static {
      return;
    }
  }
}