Skip to content

Commit a0523d6

Browse files
committed
refactor: add null check for parent
1 parent d6ce1ea commit a0523d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/output/moduleCompiler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function processModule(store: Store, src: string, filename: string) {
257257
if (!binding) {
258258
return
259259
}
260-
if (isStaticProperty(parent) && parent.shorthand) {
260+
if (parent && isStaticProperty(parent) && parent.shorthand) {
261261
// let binding used in a property shorthand
262262
// { foo } -> { foo: __import_x__.foo }
263263
// skip for destructure patterns
@@ -268,6 +268,7 @@ function processModule(store: Store, src: string, filename: string) {
268268
s.appendLeft(id.end!, `: ${binding}`)
269269
}
270270
} else if (
271+
parent &&
271272
parent.type === 'ClassDeclaration' &&
272273
id === parent.superClass
273274
) {

0 commit comments

Comments
 (0)