Skip to content

Commit

Permalink
- fixed bug, when the metaclass of detached instance had no name
Browse files Browse the repository at this point in the history
  • Loading branch information
canonic-epicure committed Apr 27, 2010
1 parent 3139ca8 commit 86be4b8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Changes
Expand Up @@ -19,7 +19,8 @@
[BUG FIXES]

- fixed bug, when traits weren't applied to the class with already detached meta
(when the meta already had traits)
(when the meta already had traits)
- fixed bug, when the metaclass of detached instance had no name


3.006 Mon, Feb 22, 2010
Expand Down
1 change: 1 addition & 0 deletions lib/Joose/Managed/Class.js
Expand Up @@ -72,6 +72,7 @@ Joose.Managed.Class = new Joose.Proto.Class('Joose.Managed.Class', {
var classWithTrait = thisMeta.subClassOf(this.constructor, { does : traits || [] })
var meta = classWithTrait.meta
meta.isDetached = true
meta.name = thisMeta.name

return meta.instantiate.call(meta, thisMeta.skipTraitsAnchor, arguments)
}
Expand Down
1 change: 1 addition & 0 deletions lib/Task/Joose/Core.js
Expand Up @@ -1784,6 +1784,7 @@ Joose.Managed.Class = new Joose.Proto.Class('Joose.Managed.Class', {
var classWithTrait = thisMeta.subClassOf(this.constructor, { does : traits || [] })
var meta = classWithTrait.meta
meta.isDetached = true
meta.name = thisMeta.name

return meta.instantiate.call(meta, thisMeta.skipTraitsAnchor, arguments)
}
Expand Down
4 changes: 3 additions & 1 deletion t/055_role_to_instance_application.t.js
@@ -1,6 +1,6 @@
StartTest(function (t) {

t.plan(54)
t.plan(55)

//==================================================================================================================================================================================
t.diag("Role application")
Expand Down Expand Up @@ -49,6 +49,8 @@ StartTest(function (t) {
t.ok(creature.constructor != Creature, "Instance was detached, indeed")
t.ok(creature instanceof Creature, "However its still creature")

t.ok(creature.meta.name == 'Creature', 'Class name for detached instances is still the same')

creature.meta.extend({
does : [{
role : Walk,
Expand Down

0 comments on commit 86be4b8

Please sign in to comment.