Can now specify parent class in extend() when implementing atop an empty base
parent
80f3ec6b68
commit
14cac6b461
|
@ -113,7 +113,7 @@ module.exports.implement = function()
|
|||
{
|
||||
// implement on empty base
|
||||
return createImplement(
|
||||
module.exports.extend(),
|
||||
null,
|
||||
Array.prototype.slice.call( arguments )
|
||||
);
|
||||
};
|
||||
|
|
|
@ -213,3 +213,22 @@ var Type = Interface.extend( {
|
|||
);
|
||||
} )();
|
||||
|
||||
|
||||
/**
|
||||
* Opposite of the above test. If a parent wasn't specified to begin with, then
|
||||
* we're fine to specify it in extend().
|
||||
*/
|
||||
( function testCanSpecifyParentIfImplementingAtopEmptyClass()
|
||||
{
|
||||
assert.doesNotThrow(
|
||||
function()
|
||||
{
|
||||
// this /should/ work
|
||||
Class.implement( Type ).extend( PlainFoo, {} );
|
||||
},
|
||||
Error,
|
||||
"Can specify parent for exetnd() when implementing atop an " +
|
||||
"empty base"
|
||||
);
|
||||
} )();
|
||||
|
||||
|
|
Loading…
Reference in New Issue