Skip to content

Commit

Permalink
fix: remove unwanted properties from both replaced and unreplaced nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 18, 2024
1 parent 00ff60e commit 4a1ef31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-mugs-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: remove unwanted properties from both replaced and unreplaced nodes
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ function remove_this_param(node, context) {
/** @type {Visitors<any, null>} */
const visitors = {
_(node, context) {
context.next();
const n = context.next() ?? node;

// TODO there may come a time when we decide to preserve type annotations.
// until that day comes, we just delete them so they don't confuse esrap
delete node.typeAnnotation;
delete node.typeParameters;
delete node.returnType;
delete node.accessibility;
delete n.typeAnnotation;
delete n.typeParameters;
delete n.returnType;
delete n.accessibility;
},
Decorator(node) {
e.typescript_invalid_feature(node, 'decorators (related TSC proposal is not stage 4 yet)');
Expand Down

0 comments on commit 4a1ef31

Please sign in to comment.