Skip to content

Commit

Permalink
Fix prototypes bug in fabrics
Browse files Browse the repository at this point in the history
  • Loading branch information
morulus committed Mar 1, 2015
1 parent 34d763d commit 2df1a03
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .dvlp/scripts/brahma/internals/module.internals.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@
if ("function"==typeof Brahma.classes.module.internals[internals[i]].initial) Brahma.classes.module.internals[internals[i]].initial.call(module);
}
}
Brahma.extend(constructor.prototype, options);
constructor.prototype.master = this;
constructor.prototype.constructor = constructor;

var module = new constructor();
Brahma.extend(module, options);
module.master = this;

return module;
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "brahma",
"version": "1.3.3",
"version": "1.3.4",
"authors": [
"Morulus <[email protected]>"
],
Expand Down
4 changes: 1 addition & 3 deletions dist/brahma.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,9 @@ Brahma.die= function(a) {
if ("function"==typeof Brahma.classes.module.internals[internals[i]].initial) Brahma.classes.module.internals[internals[i]].initial.call(module);
}
}
Brahma.extend(constructor.prototype, options);
constructor.prototype.master = this;
constructor.prototype.constructor = constructor;

var module = new constructor();
Brahma.extend(module, options);
module.master = this;

return module;
Expand Down
12 changes: 11 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ <h2>Hi</h2>
assert.equal(window.testready, true, "DOM ready!");
start();
});
})
});

QUnit.test("test modules", function( assert ) {
var app1 = Brahma.app('test1', {
a: 123
});
var app2 = Brahma.app('test2', {
a: 456
});
assert.equal(app2.a+app1.a, 579, "prototypes different");
});
</script>
</html>

0 comments on commit 2df1a03

Please sign in to comment.