diff --git a/lib/class.js b/lib/class.js index ff9d7bd..f1ba4e9 100644 --- a/lib/class.js +++ b/lib/class.js @@ -217,7 +217,8 @@ var extend = ( function( extending ) prototype, prototype, prototype ), - abstract_methods = util.clone( base.abstractMethods ) + abstract_methods = + util.clone( getMeta( base.__cid ).abstractMethods ) || { __length: 0 } ; @@ -303,7 +304,8 @@ var extend = ( function( extending ) util.freeze( 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 extending = false; @@ -512,11 +514,6 @@ function attachAbstract( func, methods ) { 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: [], }; } + + return class_meta[ id ]; } @@ -642,6 +641,6 @@ function createMeta( func, parent_id ) */ function getMeta( id ) { - return class_meta[ id ]; + return class_meta[ id ] || {}; }