From 072fef2dc02e4932a32518e910c451e04d11b1b5 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 7 Jul 2014 22:01:23 -0400 Subject: [PATCH] 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. --- lib/ClassBuilder.js | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/lib/ClassBuilder.js b/lib/ClassBuilder.js index 3a6f8a9..6d94c36 100644 --- a/lib/ClassBuilder.js +++ b/lib/ClassBuilder.js @@ -1255,27 +1255,13 @@ function createMeta( func, cparent ) // copy the parent prototype's metadata if it exists (inherit metadata) if ( parent_meta ) { - func[ _priv ].meta = util.clone( parent_meta, true ); - } - else - { - // create empty - func[ _priv ].meta = { - implemented: [], - }; + return func[ _priv ].meta = util.clone( parent_meta, true ); } - // TODO: this should be done elsewhere - if ( !func.prototype[ _priv ] ) - { - 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; + // create empty + return func[ _priv ].meta = { + implemented: [], + }; }