1
0
Fork 0

Abstract methods list is no longer public

closure/master
Mike Gerwitz 2011-01-25 00:24:50 -05:00
parent fb5d541ea3
commit 8c7ad787c8
1 changed files with 7 additions and 8 deletions

View File

@ -217,7 +217,8 @@ var extend = ( function( extending )
prototype, prototype, prototype prototype, prototype, prototype
), ),
abstract_methods = util.clone( base.abstractMethods ) abstract_methods =
util.clone( getMeta( base.__cid ).abstractMethods )
|| { __length: 0 } || { __length: 0 }
; ;
@ -303,7 +304,8 @@ var extend = ( function( extending )
util.freeze( new_class ); util.freeze( new_class );
// create internal metadata for the new class // create internal metadata for the new class
createMeta( new_class, base.prototype.__cid ); var meta = createMeta( new_class, base.prototype.__cid );
meta.abstractMethods = abstract_methods;
// we're done with the extension process // we're done with the extension process
extending = false; extending = false;
@ -512,11 +514,6 @@ function attachAbstract( func, methods )
{ {
return is_abstract; return is_abstract;
}); });
// attach the list of abstract methods to the class (make the copy of the
// methods to ensure that they won't be gc'd or later modified and screw up
// the value)
util.defineSecureProp( func, 'abstractMethods', methods );
} }
@ -627,6 +624,8 @@ function createMeta( func, parent_id )
implemented: [], implemented: [],
}; };
} }
return class_meta[ id ];
} }
@ -642,6 +641,6 @@ function createMeta( func, parent_id )
*/ */
function getMeta( id ) function getMeta( id )
{ {
return class_meta[ id ]; return class_meta[ id ] || {};
} }