|
|
@ -57,7 +57,10 @@ export function ClassBody(node, context) {
|
|
|
|
e.state_field_duplicate(node, name);
|
|
|
|
e.state_field_duplicate(node, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const _key = (key.type === 'PrivateIdentifier' ? '#' : '') + name;
|
|
|
|
const _key =
|
|
|
|
|
|
|
|
(node.type === 'AssignmentExpression' || !node.static ? '' : '@') +
|
|
|
|
|
|
|
|
(key.type === 'PrivateIdentifier' ? '#' : '') +
|
|
|
|
|
|
|
|
name;
|
|
|
|
const field = fields.get(_key);
|
|
|
|
const field = fields.get(_key);
|
|
|
|
|
|
|
|
|
|
|
|
// if there's already a method or assigned field, error
|
|
|
|
// if there's already a method or assigned field, error
|
|
|
@ -91,7 +94,10 @@ export function ClassBody(node, context) {
|
|
|
|
if (child.kind === 'constructor') {
|
|
|
|
if (child.kind === 'constructor') {
|
|
|
|
constructor = child;
|
|
|
|
constructor = child;
|
|
|
|
} else if (!child.computed) {
|
|
|
|
} else if (!child.computed) {
|
|
|
|
const key = (child.key.type === 'PrivateIdentifier' ? '#' : '') + get_name(child.key);
|
|
|
|
const key =
|
|
|
|
|
|
|
|
(child.static ? '@' : '') +
|
|
|
|
|
|
|
|
(child.key.type === 'PrivateIdentifier' ? '#' : '') +
|
|
|
|
|
|
|
|
get_name(child.key);
|
|
|
|
const field = fields.get(key);
|
|
|
|
const field = fields.get(key);
|
|
|
|
if (!field) {
|
|
|
|
if (!field) {
|
|
|
|
fields.set(key, [child.kind]);
|
|
|
|
fields.set(key, [child.kind]);
|
|
|
|