From d26f441a5cb5361e626f57c0c57dc1fd16d8f3ec Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 14 Dec 2014 12:19:24 +1100 Subject: [PATCH] support falsy and null super classes - fixes #284 --- lib/6to5/templates/extends.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/6to5/templates/extends.js b/lib/6to5/templates/extends.js index bc950dfd9a..1e8f6b5e8f 100644 --- a/lib/6to5/templates/extends.js +++ b/lib/6to5/templates/extends.js @@ -1,5 +1,5 @@ (function (child, parent) { - child.prototype = Object.create(parent.prototype, { + child.prototype = Object.create(parent && parent.prototype, { constructor: { value: child, enumerable: false, @@ -7,5 +7,5 @@ configurable: true } }); - child.__proto__ = parent; + if (parent) child.__proto__ = parent; })