From 330e537c6a97f2177b1efe723882c0ab031c584d Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Fri, 20 Jul 2012 10:56:14 +0200 Subject: [PATCH] changed call arg --- Factory.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Factory.js b/Factory.js index 3cebe6a..684e690 100644 --- a/Factory.js +++ b/Factory.js @@ -18,7 +18,7 @@ Factory.prototype.new = function (constructor /*, arg1, arg2, ... */) { } }); - constructor.apply(instance, Array.prototype.slice.call(arguments, [1])); + constructor.apply(instance, Array.prototype.slice.call(arguments, 1)); return instance; } @@ -45,6 +45,8 @@ player.factory.new(Player, "logsol").notificationCenter.log("test"); /* Lala:chuck.js jeena$ node Factory.js -foo +Player jeena created +Player logsol created +test */ \ No newline at end of file