@@ -19,6 +19,7 @@ var upperCaseRegExp = new RegExp('[A-Z]+');
1919
2020// Object pools by component, created upon registration.
2121var objectPools = { } ;
22+ var emptyInitialOldData = Object . freeze ( { } ) ;
2223
2324/**
2425 * Component class definition.
@@ -223,7 +224,7 @@ Component.prototype = {
223224 }
224225 utils . objectPool . clearObject ( this . attrValue ) ;
225226 this . attrValue = extendProperties ( this . attrValue , newAttrValue , this . isObjectBased ) ;
226- utils . objectPool . clearObject ( tempObject ) ;
227+ this . objectPool . recycle ( tempObject ) ;
227228 } ,
228229
229230 /**
@@ -271,7 +272,7 @@ Component.prototype = {
271272 *
272273 * @param {string } attrValue - HTML attribute value.
273274 * If undefined, use the cached attribute value and continue updating properties.
274- * @param {boolean } clobber - The previous component data is overwritten by the atrrValue .
275+ * @param {boolean } clobber - The previous component data is overwritten by the attrValue .
275276 */
276277 updateProperties : function ( attrValue , clobber ) {
277278 var el = this . el ;
@@ -324,9 +325,8 @@ Component.prototype = {
324325
325326 // For oldData, pass empty object to multiple-prop schemas or object single-prop schema.
326327 // Pass undefined to rest of types.
327- initialOldData = this . isObjectBased ? this . objectPool . use ( ) : undefined ;
328+ initialOldData = this . isObjectBased ? emptyInitialOldData : undefined ;
328329 this . update ( initialOldData ) ;
329- if ( this . isObjectBased ) { this . objectPool . recycle ( initialOldData ) ; }
330330
331331 // Play the component if the entity is playing.
332332 if ( el . isPlaying ) { this . play ( ) ; }
0 commit comments