joaonuno/tree-model-js — pull request #2 by drfloob (2013-08-10 18:44:03+00:00)
Title: Fix for `addChild()` happening out of order

This commit relies on my previous work in Pull Request #1 (branch drfloob:feature/unstable_sort).

`addChild()` was adding children correctly to the model, but adding out of order to the tree itself. The first child would always be pushed to the end of the array.

Test added in commit 9da1ede. Fix added in 51b036d.