1
0
Fork 0

createMeta no longer copying to new_class.prototype

I do not wholly recall why this was done initially (nor do I care to
research it, since it's not necessary now), but from the looks of it, it was
likely a kluge to handle a poor implementation of some feature.

This will help clean up a little, since it's rude to pollute a prototype
unnecessarily.
protolib
Mike Gerwitz 2014-07-07 22:01:23 -04:00
parent 17d11c1832
commit 072fef2dc0
1 changed files with 5 additions and 19 deletions

View File

@ -1255,27 +1255,13 @@ function createMeta( func, cparent )
// copy the parent prototype's metadata if it exists (inherit metadata) // copy the parent prototype's metadata if it exists (inherit metadata)
if ( parent_meta ) if ( parent_meta )
{ {
func[ _priv ].meta = util.clone( parent_meta, true ); return func[ _priv ].meta = util.clone( parent_meta, true );
}
else
{
// create empty
func[ _priv ].meta = {
implemented: [],
};
} }
// TODO: this should be done elsewhere // create empty
if ( !func.prototype[ _priv ] ) return func[ _priv ].meta = {
{ implemented: [],
func.prototype[ _priv ] = {}; };
}
// store the metadata in the prototype as well (inconsiderable overhead;
// it's just a reference)
func.prototype[ _priv ].meta = func[ _priv ].meta;
return func[ _priv ].meta;
} }