(fn)
| 17279 | return newParticles |
| 17280 | } |
| 17281 | replaceParticle(fn) { |
| 17282 | const parent = this.parent |
| 17283 | const index = this.index |
| 17284 | const newParticles = new Particle(fn(this.toString())) |
| 17285 | const returnedParticles = [] |
| 17286 | newParticles.forEach((subparticle, subparticleIndex) => { |
| 17287 | const newParticle = parent.insertLineAndSubparticles(subparticle.getLine(), subparticle.subparticlesToString(), index + subparticleIndex) |
| 17288 | returnedParticles.push(newParticle) |
| 17289 | }) |
| 17290 | this.destroy() |
| 17291 | return returnedParticles |
| 17292 | } |
| 17293 | insertLineAndSubparticles(line, subparticles, index) { |
| 17294 | return this._insertBlock(this._makeBlock(line, subparticles), index) |
| 17295 | } |
no test coverage detected