Add tests that public and private static fields are unsupported

This commit is contained in:
Daniel Ehrenberg 2017-12-21 20:58:29 +01:00 committed by Rick Waldron
parent 2e042d9f9d
commit dc4db968f2
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,10 @@
// Copyright (C) 2017 Igalia, S. L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Static private fields are not supported
features: [class, class-fields-private]
---*/
assert.throws.early(SyntaxError, "class C { static #field; }");
assert.throws.early(SyntaxError, "class C { static #field = 0; }");

View File

@ -0,0 +1,11 @@
// Copyright (C) 2017 Igalia, S. L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Static public fields are not supported
features: [class, class-fields-public]
---*/
assert.throws.early(SyntaxError, "class C { static field; }");
assert.throws.early(SyntaxError, "class C { static field = 0; }");
assert.throws.early(SyntaxError, "class C { static ['field']; }");
assert.throws.early(SyntaxError, "class C { static ['field'] = 0; }");