Moved named class argument check error to a more sensible location and amended error message
parent
0ccdf07145
commit
bedc3c95af
|
@ -259,17 +259,17 @@ function createNamedClass( name, def )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the name to the definition
|
|
||||||
def.__name = name;
|
|
||||||
|
|
||||||
// the definition must be an object
|
// the definition must be an object
|
||||||
if ( typeof def !== 'object' )
|
if ( typeof def !== 'object' )
|
||||||
{
|
{
|
||||||
throw TypeError(
|
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 );
|
return extend( def );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue