1
0
Fork 0

Removed Class.abstractMethod in favor of property keyword

closure/master
Mike Gerwitz 2010-12-27 22:11:37 -05:00
parent f705f38640
commit e789e58000
3 changed files with 17 additions and 11 deletions

View File

@ -39,9 +39,6 @@ exports.extend = function( base )
} }
exports.abstractMethod = util.createAbstractMethod;
/** /**
* Default class implementation * Default class implementation
* *

View File

@ -191,6 +191,18 @@ exports.propParse = function( data, options )
callback_each.call( callback_each, name, value ); 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 // getter/setter
if ( getter || setter ) if ( getter || setter )
{ {
@ -204,10 +216,7 @@ exports.propParse = function( data, options )
callback_method, callback_method,
name, name,
value, value,
( ( keywords['abstract'] ) exports.isAbstractMethod( value )
? true
: exports.isAbstractMethod( value )
)
); );
} }
// simple property // simple property

View File

@ -25,7 +25,7 @@
var common = require( './common' ), var common = require( './common' ),
assert = require( 'assert' ), assert = require( 'assert' ),
Class = common.require( 'class' ), Class = common.require( 'class' ),
abstractMethod = common.require( 'class' ).abstractMethod, abstractMethod = common.require( 'util' ).createAbstractMethod,
util = common.require( 'util' ); util = common.require( 'util' );
// not abstract // not abstract
@ -41,9 +41,9 @@ var AbstractFoo = Class.extend(
this.ctorCalled = true; 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 // still abstract (didn't provide a concrete implementation of both abstract