From c828688d21337499e90b88e683de6dada0448d53 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Mar 2015 00:23:07 +1100 Subject: [PATCH] add existence check to t.inherits --- src/babel/types/index.js | 2 ++ 1 file changed, 2 insertions(+) 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;