MCPcopy Index your code
hub / github.com/melonjs/melonJS / push

Method push

packages/melonjs/src/system/legacy_pool.js:172–186  ·  view source on GitHub ↗

* Push back an object instance into the object pool * Object pooling for the object class must be enabled, * and object must have been instantiated using pull, * otherwise this function won't work * @throws will throw an error if the object cannot be recycled * @param {object}

(obj, throwOnError = true)

Source from the content-addressed store, hash-verified

170 * @returns {boolean} true if the object was successfully recycled in the object pool
171 */
172 push(obj, throwOnError = true) {
173 if (!this.poolable(obj)) {
174 if (throwOnError === true) {
175 throw new Error("me.pool: object " + obj + " cannot be recycled");
176 } else {
177 return false;
178 }
179 }
180
181 // store back the object instance for later recycling
182 this.objectClass[obj.className].pool.push(obj);
183 this.instance_counter++;
184
185 return true;
186 }
187
188 /**
189 * Check if an object with the provided name is registered

Callers 15

onMethod · 0.45
queryAABBMethod · 0.45
onCollisionStartMethod · 0.45
onCollisionActiveMethod · 0.45
onCollisionEndMethod · 0.45
onCollisionStartMethod · 0.45
onCollisionMethod · 0.45
onCollisionMethod · 0.45
onCollisionActiveMethod · 0.45
onCollisionMethod · 0.45
onCollisionStartMethod · 0.45
onCollisionStartMethod · 0.45

Calls 1

poolableMethod · 0.95

Tested by 14

onCollisionStartMethod · 0.36
onCollisionActiveMethod · 0.36
onCollisionEndMethod · 0.36
onCollisionStartMethod · 0.36
onCollisionMethod · 0.36
onCollisionMethod · 0.36
onCollisionActiveMethod · 0.36
onCollisionMethod · 0.36
onCollisionStartMethod · 0.36
onCollisionStartMethod · 0.36
onCollisionStartMethod · 0.36
onCollisionActiveMethod · 0.36