mirror of https://github.com/tc39/test262.git
Adding case where 'static' is used as a field name
This commit is contained in:
parent
4bf836c898
commit
432adbb61e
|
@ -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
|
||||
});
|
||||
|
|
@ -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
|
||||
});
|
||||
|
|
@ -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
|
||||
});
|
||||
|
Loading…
Reference in New Issue