Skip to content

Commit

Permalink
fix: Does not handle undefined private properties
Browse files Browse the repository at this point in the history
Fixes #609
  • Loading branch information
davidbonnet committed Apr 28, 2022
1 parent 9cb3964 commit e6b8ee6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/astring.js
Expand Up @@ -826,6 +826,9 @@ export const GENERATOR = {
state.write('static ')
}
this[node.key.type](node.key, state)
if (node.value == null) {
return
}
state.write(' = ')
this[node.value.type](node.value, state)
},
Expand Down
1 change: 1 addition & 0 deletions src/tests/fixtures/syntax/class.js
Expand Up @@ -51,6 +51,7 @@ class O {
#a = 42
#b() {}
static #c = 'C'
#d
static {
const a = 3;
}
Expand Down

0 comments on commit e6b8ee6

Please sign in to comment.