assignSymbols
Assign well known symbols and values to an object.
.assignSymbols(target, source)
Converts each property name on the source object to a well known symbol
and uses that symbol to set the corresponding value on target.
This is used to easily set symbols correctly even when symbol isn't natively supported.
canReflect.assignSymbols(Map.prototype, {
"can.getKeyValue": Map.prototype.get
})
If a source property name matches a symbol on Symbol (like iterator on Symbol.iterator),
that symbol will be used:
canReflect.assignSymbols(ArrayLike.prototype, {
"iterator": function() { ... }
})
ArrayLike.prototype[Symbol.iterator] = function(){ ... }
Parameters
- target
{Object}:The value that will be updated with
source's symbols and values. - source
{Object<name,value>}:A source of symbol names and values to copy to
target.
Returns
{Object}:
The target.