diff --git a/src/class-elements/static-as-valid-static-field.case b/src/class-elements/static-as-valid-static-field.case new file mode 100644 index 0000000000..72ee2c84ac --- /dev/null +++ b/src/class-elements/static-as-valid-static-field.case @@ -0,0 +1,24 @@ +// Copyright (C) 2020 Igalia S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: static is a valid name of a static field +info: | + ClassElement: + ... + static FieldDefinition ; +template: default +includes: [propertyHelper.js] +features: [class-static-fields-public] +---*/ + +//- elements +static static; +//- assertions +verifyProperty(C, "static", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + diff --git a/test/language/expressions/class/elements/static-as-valid-static-field.js b/test/language/expressions/class/elements/static-as-valid-static-field.js new file mode 100644 index 0000000000..bc0aaae78a --- /dev/null +++ b/test/language/expressions/class/elements/static-as-valid-static-field.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/static-as-valid-static-field.case +// - src/class-elements/default/cls-expr.template +/*--- +description: static is a valid name of a static field (field definitions in a class expression) +esid: prod-FieldDefinition +features: [class-static-fields-public, class] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + static FieldDefinition ; + +---*/ + + +var C = class { + static static; +} + +verifyProperty(C, "static", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + diff --git a/test/language/statements/class/elements/static-as-valid-static-field.js b/test/language/statements/class/elements/static-as-valid-static-field.js new file mode 100644 index 0000000000..77a8c1ea02 --- /dev/null +++ b/test/language/statements/class/elements/static-as-valid-static-field.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/static-as-valid-static-field.case +// - src/class-elements/default/cls-decl.template +/*--- +description: static is a valid name of a static field (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-static-fields-public, class] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + static FieldDefinition ; + +---*/ + + +class C { + static static; +} + +verifyProperty(C, "static", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); +