Closed karlwestin closed 10 years ago
We need to check the next item because otherwise, it'll assume that we're creating a regular object rather than an array, right? Looks good (other than a bit extra whitespace).
yeah thats how the bug came out so this bug only really came into effect when you started with setting a big key where nothing of the structure existed before
if you did
new Backbone.NestedModel({
array: [{ myObject: 10 }]
})
things came out ok, but if you did
new Backbone.NestedModel({
"array[0].myObject": 10
})
you'd see the bug
Fixed the whitespace, thanks for seeing it
:+1:
To determine whether a newly created nest-level should be an object or an array, we need to look at the next value in the path. Please run the tests without the patch in backbone-nested to see the bug in action. Thanks
Closes #78