From 3b5d73f5cee0921c692e53e5b1e6489a61e8faa9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 16 Jun 2015 12:13:18 -0700 Subject: [PATCH] Use Object.create(null) in __extends when base is null --- src/compiler/emitter.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8081668f98c..5181a0f17f5 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -21,8 +21,7 @@ namespace ts { var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); };`; // emit output for the __decorate helper function