premasagar / pablo

Pablo is a lightweight, expressive JavaScript SVG library. Pablo creates interactive drawings with SVG (Scalable Vector Graphics), giving access to all of SVG's granularity and power.
https://pablojs.com
MIT License
413 stars 16 forks source link

PabloCollection.concat() should return a new Pablo Collection #33

Closed AaronAcerboni closed 11 years ago

AaronAcerboni commented 11 years ago

Currently concat is an alias for push and add which are mutators. Instead concat should be more in line with the native array method which returns a new collection/array.

AaronAcerboni commented 11 years ago

I'm re-opening this issue because I don't think it has been solved.

Concat is still mutating the original array.

Steps to reproduce:


var collection = Pablo.rect();

var returned = collection.concat(Pablo.ellipse())

returned.length // 2 which is correct
collection.length // 2 which is not correct