Skip to content

Commit d495546

Browse files
authored
fix: walksScope throw error when path.parentPath is null (#25)
1 parent 6f847c4 commit d495546

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/babel-plugin-jsx/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ const parseDirectives = (args: {
275275
};
276276

277277
const walksScope = (path: NodePath, name: string) => {
278-
if (path.scope.hasBinding(name)) {
278+
if (path.scope.hasBinding(name) && path.parentPath) {
279279
path.parentPath.setData('optimize', false);
280280
walksScope(path.parentPath, name);
281281
}

0 commit comments

Comments
 (0)