summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js
blob: 041c4be37abea9a5fc6d2a057c512a174ac0e146 (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
// |reftest| error:SyntaxError
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-method-definitions-static-semantics-early-errors
description: >
  Throws an early SyntaxError if a method definition has a private name even
  inside a class body. (async generator)
info: |
  Static Semantics: Early Errors

  PropertyDefinition : MethodDefinition
    It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
negative:
  phase: parse
  type: SyntaxError
features: [class-methods-private, async-iteration, class, class-fields-public]
---*/

$DONOTEVALUATE();

class C {
  field = {
    async * #m() {}
  }
}