Removed Class.abstractMethod in favor of property keyword
parent
f705f38640
commit
e789e58000
|
@ -39,9 +39,6 @@ exports.extend = function( base )
|
|||
}
|
||||
|
||||
|
||||
exports.abstractMethod = util.createAbstractMethod;
|
||||
|
||||
|
||||
/**
|
||||
* Default class implementation
|
||||
*
|
||||
|
|
17
lib/util.js
17
lib/util.js
|
@ -191,6 +191,18 @@ exports.propParse = function( data, options )
|
|||
callback_each.call( callback_each, name, value );
|
||||
}
|
||||
|
||||
if ( keywords['abstract'] )
|
||||
{
|
||||
if ( value instanceof Array )
|
||||
{
|
||||
value = exports.createAbstractMethod.apply( this, value );
|
||||
}
|
||||
else
|
||||
{
|
||||
value = exports.createAbstractMethod();
|
||||
}
|
||||
}
|
||||
|
||||
// getter/setter
|
||||
if ( getter || setter )
|
||||
{
|
||||
|
@ -204,10 +216,7 @@ exports.propParse = function( data, options )
|
|||
callback_method,
|
||||
name,
|
||||
value,
|
||||
( ( keywords['abstract'] )
|
||||
? true
|
||||
: exports.isAbstractMethod( value )
|
||||
)
|
||||
exports.isAbstractMethod( value )
|
||||
);
|
||||
}
|
||||
// simple property
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' ),
|
||||
abstractMethod = common.require( 'class' ).abstractMethod,
|
||||
abstractMethod = common.require( 'util' ).createAbstractMethod,
|
||||
util = common.require( 'util' );
|
||||
|
||||
// not abstract
|
||||
|
@ -41,9 +41,9 @@ var AbstractFoo = Class.extend(
|
|||
this.ctorCalled = true;
|
||||
},
|
||||
|
||||
method: abstractMethod( 'one', 'two', 'three' ),
|
||||
'abstract method': [ 'one', 'two', 'three' ],
|
||||
|
||||
second: abstractMethod(),
|
||||
'abstract second': [],
|
||||
});
|
||||
|
||||
// still abstract (didn't provide a concrete implementation of both abstract
|
||||
|
|
Loading…
Reference in New Issue