Test ensuring `#use` staging object satisfies `Class.isClass`
parent
867127ed2f
commit
f3a8dea25d
|
@ -78,11 +78,5 @@ complete.
|
||||||
improvement. Until that time, be mindful of the performance test
|
improvement. Until that time, be mindful of the performance test
|
||||||
cases in the =test/perf= directory.
|
cases in the =test/perf= directory.
|
||||||
|
|
||||||
* TODO Intermediate object as class
|
|
||||||
The immediate syntax---=Foo.use(T)()=---is a short-hand equivalent
|
|
||||||
of =Foo.use(T).extend({})()=. As such, for consistency, =Class.isA=
|
|
||||||
should consider the intermediate object returned by a call to =use=
|
|
||||||
to be a class.
|
|
||||||
|
|
||||||
If we are to do so, though, we must make sure that the entire class
|
If we are to do so, though, we must make sure that the entire class
|
||||||
API is supported.
|
API is supported.
|
||||||
|
|
|
@ -455,4 +455,24 @@ require( 'common' ).testCase(
|
||||||
Sut( dfn );
|
Sut( dfn );
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The stating object rendered by `#use` calls implement the same
|
||||||
|
* methods as classes, and are even treated as classes when invoked
|
||||||
|
* using the immediate syntax (see ImmediateTest). When defining
|
||||||
|
* abstract classes, staging objects may be extended as if they were
|
||||||
|
* classes (see AbstractTest).
|
||||||
|
*
|
||||||
|
* It makes sense for staging objects to be able to be treated as if
|
||||||
|
* they were classes, which demands reflection API consistency.
|
||||||
|
*/
|
||||||
|
'Staging object for eventual mixin is considered to be class': function()
|
||||||
|
{
|
||||||
|
var T = this.Sut( {} );
|
||||||
|
|
||||||
|
this.assertOk(
|
||||||
|
this.Class.isClass( this.Class( {} ).use( T ) )
|
||||||
|
);
|
||||||
|
},
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in New Issue