Skip to content

Commit

Permalink
fix: remove unwanted properties from both replaced and unreplaced nod…
Browse files Browse the repository at this point in the history
…es (#14744)
  • Loading branch information
Rich-Harris authored Dec 18, 2024
1 parent 00ff60e commit e38975e
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 e38975e

Please sign in to comment.