mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
still not working with create
This commit is contained in:
parent
d3e7389c57
commit
3ee7c197f9
1 changed files with 7 additions and 8 deletions
15
Factory.js
15
Factory.js
|
|
@ -11,13 +11,12 @@ Factory.prototype.new = function () {
|
|||
|
||||
var module = arguments[0];
|
||||
|
||||
return Object.create(
|
||||
module.prototype,
|
||||
{
|
||||
factory: {value: this},
|
||||
notificationCenter: {value: this.notificationCenter}
|
||||
}
|
||||
);
|
||||
var o = Object.create(module.prototype, {
|
||||
factory: {value: this},
|
||||
notificationCenter: {value: this.notificationCenter}
|
||||
});
|
||||
|
||||
return new (o.call(arguments))();
|
||||
}
|
||||
|
||||
function Player(name) {
|
||||
|
|
@ -36,7 +35,7 @@ var factory = new Factory();
|
|||
|
||||
var player = factory.new(Player, "jeena");
|
||||
|
||||
player.factory.new(Player, "logsol").notificationCenter.alert("foo");
|
||||
player.factory.new(Player, "logsol").name;
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue