2017-10-26 23:58:33 +02:00
|
|
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
|
|
esid: sec-scripts-static-semantics-early-errors
|
|
|
|
description: Early error when referencing privatename in constructor without being declared in class fields
|
|
|
|
info: |
|
|
|
|
Static Semantics: Early Errors
|
|
|
|
Script : ScriptBody
|
|
|
|
1. Let names be an empty List.
|
|
|
|
...
|
|
|
|
3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception.
|
2017-11-28 18:59:27 +01:00
|
|
|
features: [class, class-fields-private]
|
2017-10-26 23:58:33 +02:00
|
|
|
negative:
|
|
|
|
phase: early
|
|
|
|
type: SyntaxError
|
|
|
|
---*/
|
|
|
|
|
|
|
|
throw "Test262: This statement should not be evaluated.";
|
|
|
|
|
|
|
|
class C {
|
|
|
|
constructor() {
|
|
|
|
this.#x;
|
|
|
|
}
|
|
|
|
}
|