Adding case where 'static' is used as a field name

This commit is contained in:
Caio Lima 2020-03-28 14:47:56 -03:00 committed by Rick Waldron
parent 4bf836c898
commit 432adbb61e
3 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,32 @@
// 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 an instance field
info: |
ClassElement:
...
FieldDefinition ;
FieldDefinition:
ClassElementName Initializer_opt
ClassElementName:
PropertyName
template: default
includes: [propertyHelper.js]
features: [class-fields-public]
---*/
//- elements
static = "foo";
//- assertions
let c = new C();
verifyProperty(c, "static", {
value: "foo",
enumerable: true,
writable: true,
configurable: true
});

View File

@ -0,0 +1,36 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/static-as-valid-instance-field.case
// - src/class-elements/default/cls-expr.template
/*---
description: static is a valid name of an instance field (field definitions in a class expression)
esid: prod-FieldDefinition
features: [class-fields-public, class]
flags: [generated]
includes: [propertyHelper.js]
info: |
ClassElement:
...
FieldDefinition ;
FieldDefinition:
ClassElementName Initializer_opt
ClassElementName:
PropertyName
---*/
var C = class {
static = "foo";
}
let c = new C();
verifyProperty(c, "static", {
value: "foo",
enumerable: true,
writable: true,
configurable: true
});

View File

@ -0,0 +1,36 @@
// This file was procedurally generated from the following sources:
// - src/class-elements/static-as-valid-instance-field.case
// - src/class-elements/default/cls-decl.template
/*---
description: static is a valid name of an instance field (field definitions in a class declaration)
esid: prod-FieldDefinition
features: [class-fields-public, class]
flags: [generated]
includes: [propertyHelper.js]
info: |
ClassElement:
...
FieldDefinition ;
FieldDefinition:
ClassElementName Initializer_opt
ClassElementName:
PropertyName
---*/
class C {
static = "foo";
}
let c = new C();
verifyProperty(c, "static", {
value: "foo",
enumerable: true,
writable: true,
configurable: true
});