fix: cleanup `superTypeParameters` in `ClassDeclarations`/`ClassExpression` (#18015)

Closes #18012

We were removing `superTypeArguments` but the AST showed
`superTypeParameters`.

Luckily, I was able to pinpoint `esrap@2.2.4` as the cause... I've only
bumped `esrap` and that made the test fail (so that I could fix it)

And of course it was that...there's literally a commit that explicitly
print them lol


f9137c4101
pull/18006/head
Paolo Ricciuti 5 months ago committed by GitHub
parent a9d8439ad1
commit 957f2755fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: cleanup `superTypeParameters` in `ClassDeclarations`/`ClassExpression`

@ -178,7 +178,7 @@
"clsx": "^2.1.1", "clsx": "^2.1.1",
"devalue": "^5.6.4", "devalue": "^5.6.4",
"esm-env": "^1.2.1", "esm-env": "^1.2.1",
"esrap": "^2.2.2", "esrap": "^2.2.4",
"is-reference": "^3.0.3", "is-reference": "^3.0.3",
"locate-character": "^3.0.0", "locate-character": "^3.0.0",
"magic-string": "^0.30.11", "magic-string": "^0.30.11",

@ -138,11 +138,13 @@ const visitors = {
delete node.abstract; delete node.abstract;
delete node.implements; delete node.implements;
delete node.superTypeArguments; delete node.superTypeArguments;
delete node.superTypeParameters;
return context.next(); return context.next();
}, },
ClassExpression(node, context) { ClassExpression(node, context) {
delete node.implements; delete node.implements;
delete node.superTypeArguments; delete node.superTypeArguments;
delete node.superTypeParameters;
return context.next(); return context.next();
}, },
MethodDefinition(node, context) { MethodDefinition(node, context) {

@ -27,6 +27,11 @@
abstract x(): void; abstract x(): void;
y() {} y() {}
} }
class Subclass extends Foo<string> {
constructor(value: string) {
super(value);
}
}
declare const declared_const: number; declare const declared_const: number;
declare function declared_fn(): void; declare function declared_fn(): void;

@ -102,8 +102,8 @@ importers:
specifier: ^1.2.1 specifier: ^1.2.1
version: 1.2.1 version: 1.2.1
esrap: esrap:
specifier: ^2.2.2 specifier: ^2.2.4
version: 2.2.2 version: 2.2.4
is-reference: is-reference:
specifier: ^3.0.3 specifier: ^3.0.3
version: 3.0.3 version: 3.0.3
@ -1418,8 +1418,8 @@ packages:
resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==}
engines: {node: '>=0.10'} engines: {node: '>=0.10'}
esrap@2.2.2: esrap@2.2.4:
resolution: {integrity: sha512-zA6497ha+qKvoWIK+WM9NAh5ni17sKZKhbS5B3PoYbBvaYHZWoS33zmFybmyqpn07RLUxSmn+RCls2/XF+d0oQ==} resolution: {integrity: sha512-suICpxAmZ9A8bzJjEl/+rLJiDKC0X4gYWUxT6URAWBLvlXmtbZd5ySMu/N2ZGEtMCAmflUDPSehrP9BQcsGcSg==}
esrecurse@4.3.0: esrecurse@4.3.0:
resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
@ -3794,9 +3794,10 @@ snapshots:
dependencies: dependencies:
estraverse: 5.3.0 estraverse: 5.3.0
esrap@2.2.2: esrap@2.2.4:
dependencies: dependencies:
'@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/sourcemap-codec': 1.5.0
'@typescript-eslint/types': 8.56.0
esrecurse@4.3.0: esrecurse@4.3.0:
dependencies: dependencies:

Loading…
Cancel
Save