mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-13 02:59:13 +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) => {
|
const walksScope = (path: NodePath, name: string) => {
|
||||||
if (path.scope.hasBinding(name)) {
|
if (path.scope.hasBinding(name) && path.parentPath) {
|
||||||
path.parentPath.setData('optimize', false);
|
path.parentPath.setData('optimize', false);
|
||||||
walksScope(path.parentPath, name);
|
walksScope(path.parentPath, name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user