Releases: canjs/can-reflect
Fixing tests in IE9
Change to not try to set a name on functions that already have a name property that is non-configurable and/or non-writable.
getPriority and setPriority
var obj = canReflect.assignSymbols({},{
"can.setPriority": function(priority){
return this.priority = priority;
}
});
canReflect.setPriority(obj, 0) //-> true
obj.priority //-> 0
canReflect.setPriority({},20) //-> false
assignSymbols works with symbols on Symbol
var list = ["a","b","c"];
canReflect.assignSymbols(list,{
"can.onPatches": function(){
},
"iterator": function(){
return list[Symbol.iterator]()
}
})
Pass through onEvent arguments
If passing multiple arguments to onEvent(arg1,arg2, etc)
, all arguments will be forwarded to the underlying symbol's function.
isObservableLike defaults to returning false
Prior to this release:
canReflect.isObservableLike([]) //undefined
canReflect.isObservableLike({}) //undefined
canReflect.isObservableLike(null) //false
Expected/fixed behavior:
canReflect.isObservableLike([]) //false
canReflect.isObservableLike({}) //false
canReflect.isObservableLike(null) //false
This release also adds new NPM scripts to package.json, include release management and cycle detection.
Fixing Issues with Map and Set in IE11
Fixing issue with `typeof` check with `undefined`
size, assign[Deep], update[Deep]
This documents size, assign
, update
, assignDeep
and updateDeep
.
Support [Weak][Map|Set]
#43 Adds support for Map and Set and their weak variants.
Added checks for Map/Set in unsupported browsers
Map/Set are not supported in IE 11 for serialization.
IE 9/10 do not support Map/Set and even using if(Map) {}
will cause an error.
Switched to using typeof Map !== 'undefined'
In addition in IE 11 Map/Set do not properly have toString
defined and will return [object Object]
rather than [object Set]
or [object Map]
so we make sure not to test in those cases.