From 9e6b0b45b344f0ede91cfd64943a10e87c290a28 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 22 Nov 2014 23:27:39 +1100 Subject: [PATCH] Revert "Merge pull request #203 from RReverser/ctor-spread-speedup" This reverts commit 714ca9fbc8f79892c43859af09277ab8413f710c, reversing changes made to d50d4972a7742bff165c6841be0ca4e4f75b5ff4. --- lib/6to5/templates/apply-constructor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/6to5/templates/apply-constructor.js b/lib/6to5/templates/apply-constructor.js index 9cbb8fb907..b02f831251 100644 --- a/lib/6to5/templates/apply-constructor.js +++ b/lib/6to5/templates/apply-constructor.js @@ -1,5 +1,5 @@ (function (Constructor, args) { - var instance = Object.create(Constructor); - Constructor.apply(instance, args); - return instance; + var bindArgs = [null].concat(args); + var Factory = Constructor.bind.apply(Constructor, bindArgs); + return new Factory; });