diff --git a/src/babel/types/index.js b/src/babel/types/index.js index de5e5a7773..30d510508b 100644 --- a/src/babel/types/index.js +++ b/src/babel/types/index.js @@ -278,6 +278,8 @@ export function inheritsComments(child: Object, parent: Object): Object { */ export function inherits(child: Object, parent: Object): Object { + if (!child || !parent) return child; + child._declarations = parent._declarations; child._scopeInfo = parent._scopeInfo; child.range = parent.range;