Releases: canjs/can-map
Fix attempts to bubble bind non-observable children
Attempts to set up bubble bindings (i.e. deep "change" listeners) when map-like children of a can-map are not observable would cause errors. This version of can-map now checks for observability on map-like children before attempting to set up bubble bindings.
See #150 for more.
Prevent bubble parent with children arrays
Children array properties should not bubble parent:
var map = new CanMap({
foo: ['item']
});
bubble.childrenOf(map, "change");
bubble.events(map.attr("foo") // -> undefined
Prevent bubble parent with children functions
This fixes bubbling the parent map with children functions as properties, for example:
var map = new CanMap({
fn: function() {}
});
bubble.childrenOf(map, "change");
bubble.events(map.fn, "change"); // -> undefined
Tests using canReflect.getName in assertions fail in IE11
Test failed due to canReflect.getName
returning a certain value fail in IE11 because of how we name functions differently in IE11. With this fix, the tests use regular expressions to make the assertions less strict.
Warn on mutations done at unsafe times
Observable data (e.g. the properties of a can-map) should not be set while derived values are being computed. With this update, users will be warned in development mode in cases where this is happening.
QUNIT2 upgrade
This updates the tests to use QUnit@2.x.x.
Use Symbol to replace __inSetup property
Replace __inSetup
property checks with Symbol.
Cleanup can-types.isMapLike(obj)
Replace usage of can-types.isMapLike(obj)
by canReflect.isObservableLike(obj) && canReflect.isMapLike(obj)
Handles props with undefined values
Makes sure that any props on the map are still added when their value is undefined
, whether during construction or set later. PR#122
Makes deep assigns and updates work with _legacyAttrBehavior
When using _legacyAttrBehavior: true
to enable the legacy attr
behavior you still want to interop with other map types. For this to
work:
map.attr({
prop: new DefineMap()
})
This works with both assign and update forms of attr().