mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-10 09:39:14 +08:00
fix: walksScope throw error when path.parentPath is null (#25)
This commit is contained in:
parent
6f847c455c
commit
d495546883
@ -275,7 +275,7 @@ const parseDirectives = (args: {
|
||||
};
|
||||
|
||||
const walksScope = (path: NodePath, name: string) => {
|
||||
if (path.scope.hasBinding(name)) {
|
||||
if (path.scope.hasBinding(name) && path.parentPath) {
|
||||
path.parentPath.setData('optimize', false);
|
||||
walksScope(path.parentPath, name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user