bitovi/canjs — pull request #340 by schovi (2013-03-31 14:09:41+00:00)
Title: Can.string getNext function fix

Fix getNext function in can.string component
There was wrong logic behind evaluation if add or not add empty object

```javascript
Before
getNext = function( obj, prop, add ) {
return prop in obj ?
obj[ prop ] :
( add && ( obj[ prop ] = {} ));
}

getNext({}, 'foo', undefined) // -> undefined // this is ok
getNext({}, 'foo', false) // -> false // instead of undefined
getNext({}, 'foo', "") // -> "" //instead of undefined
getNext({}, 'foo', true) // -> {} // which is OK
etc....

// ------------------

After
getNext = function( obj, prop, add ) {
var result = obj[prop];

if(result === undefined && add === true) { result = obj[prop] = {} }
return result
}

getNext({}, 'foo', undefined) // -> undefined
getNext({}, 'foo', false) // -> undefined
getNext({}, 'foo', "") // -> undefined
var obj = {}
getNext(obj, 'foo', true) // -> {} // and correctly obj = {foo: {}}
```