1
0
Fork 0

Named classes now support mixins

perfodd
Mike Gerwitz 2014-02-10 23:33:07 -05:00
parent 455d3a5815
commit 26bd6b88dd
2 changed files with 21 additions and 0 deletions

View File

@ -300,6 +300,14 @@ function createStaging( cname )
cname cname
); );
}, },
use: function()
{
return createUse(
null,
Array.prototype.slice.call( arguments )
);
},
}; };
} }

View File

@ -267,4 +267,17 @@ require( 'common' ).testCase(
// this one was not // this one was not
this.assertOk( this.Class.isA( Tc, o ) === false ); this.assertOk( this.Class.isA( Tc, o ) === false );
}, },
/**
* Ensure that the named class staging object permits mixins.
*/
'Can mix traits into named class': function()
{
var called = false,
T = this.Sut( { foo: function() { called = true; } } );
this.Class( 'Named' ).use( T ).extend( {} )().foo();
this.assertOk( called );
},
} ); } );