documentcloud/backbone — pull request #1002 by theluk (2012-02-14 02:15:08+00:00)
Title: Updated toJSON with extended functionality (deep toJSON)

The toJSON method in Backbone.Model ignores that there might be other models or collection in it.

To do justice to the name "toJSON" i wrote 4 extra lines where i check if the instances are either of type Backbone.Model or Backbone.Collection.

A Test is also added.