mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
changed call arg
This commit is contained in:
parent
2ab87cb063
commit
330e537c6a
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue