test262/test/language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js
Nicolò Ribaudo 7697d3a1d5 Test specific error in super-private-access-invalid.case (#2355)
Without declaring #x in the class body, the thrown error could have been
about the undeclared private name rather than about the SuperProperty
2019-09-24 13:51:10 -04:00

37 lines
729 B
JavaScript

// This file was procedurally generated from the following sources:
// - src/class-elements/super-private-access-invalid.case
// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
/*---
description: It is syntax error if PrivateName IdentifierName is accessed on SuperProperty (class declaration)
esid: prod-ClassElement
features: [class-methods-private, class]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
SuperProperty:
super[Expression]
super.IdentifierName
---*/
$DONOTEVALUATE();
class C extends B
{
#x() {}
method() {
super.#x();
}
}