test262/test/language/expressions/class/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js
2018-10-23 13:51:16 +02:00

27 lines
839 B
JavaScript

// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-privatemeth-duplicate-get-field.case
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
/*---
description: It's a SyntaxError if a class contains a private getter and a private field with the same name (class expression)
esid: prod-ClassElement
features: [class-methods-private, class-fields-private, class]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
Static Semantics: Early Errors
ClassBody : ClassElementList
It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
---*/
failIfCodeGetsEvaluated();
var C = class {
#m;
get #m() {}
};