diff --git a/lib/class.js b/lib/class.js index 3d9e0ef..b89c4d8 100644 --- a/lib/class.js +++ b/lib/class.js @@ -259,17 +259,17 @@ function createNamedClass( name, def ) ); } - // add the name to the definition - def.__name = name; - // the definition must be an object if ( typeof def !== 'object' ) { throw TypeError( - "Unexpected value for named class definition" + "Unexpected value for named class definition; object expected" ); } + // add the name to the definition + def.__name = name; + return extend( def ); }