mirror of
https://github.com/tc39/test262.git
synced 2025-06-13 02:21:03 +02:00
* Accessing `ta[0]` throws a TypeError. * Fix array indices starting at 0 and property references * Fix classfields templates for properly checking static propnames. * Generate tests * `assert.equal` is not defined * Add missing includes * Generate tests * typo s/Avalue/42/ * fix whitespace * Add missing var for strict mode * Expand generated class fields tests for forbidden computed property name values Ref https://github.com/tc39/test262/pull/1339#issuecomment-342830243 * derived classes have access to private names in base classes, if private names are in scope
32 lines
943 B
JavaScript
32 lines
943 B
JavaScript
// This file was procedurally generated from the following sources:
|
|
// - src/class-fields/static-propname-constructor.case
|
|
// - src/class-fields/propname-error-static/cls-decl-static-literal-name.template
|
|
/*---
|
|
description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value)
|
|
esid: sec-class-definitions-static-semantics-early-errors
|
|
features: [class-fields]
|
|
flags: [generated]
|
|
negative:
|
|
phase: early
|
|
type: SyntaxError
|
|
info: |
|
|
Static Semantics: PropName
|
|
LiteralPropertyName : IdentifierName
|
|
Return StringValue of IdentifierName.
|
|
|
|
|
|
// This test file tests the following early error:
|
|
Static Semantics: Early Errors
|
|
|
|
ClassElement : staticFieldDefinition;
|
|
It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
|
|
|
|
---*/
|
|
|
|
|
|
throw "Test262: This statement should not be evaluated.";
|
|
|
|
class C {
|
|
static constructor;
|
|
}
|