add existence check to t.inherits

This commit is contained in:
Sebastian McKenzie 2015-03-28 00:23:07 +11:00
parent bd052aea50
commit c828688d21

View File

@ -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;