Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cp._dependentKeys.forEach(function (dependentKey) {
Ember.assert(
'dependent array ' + dependentKey + ' must be an `Ember.Array`. ' +
'If you are not extending arrays, you will need to wrap native arrays with `Ember.A`',
!(Array.isArray(get(this, dependentKey)) && !EmberArray.detect(get(this, dependentKey))));
if (!partiallyRecomputeFor(this, dependentKey)) { return; }
var dependentArray = get(this, dependentKey);
var previousDependentArray = meta.dependentArrays[dependentKey];
if (dependentArray === previousDependentArray) {
// The array may be the same, but our item property keys may have
// changed, so we set them up again. We can't easily tell if they've
// changed: the array may be the same object, but with different
// contents.
if (cp._previousItemPropertyKeys[dependentKey]) {
meta.dependentArraysObserver.teardownPropertyObservers(dependentKey, cp._previousItemPropertyKeys[dependentKey]);
delete cp._previousItemPropertyKeys[dependentKey];
meta.dependentArraysObserver.setupPropertyObservers(dependentKey, cp._itemPropertyKeys[dependentKey]);
function partiallyRecomputeFor(obj, dependentKey) {
if (arrayBracketPattern.test(dependentKey)) {
return false;
}
var value = get(obj, dependentKey);
return EmberArray.detect(value);
}
_assertArrayLike(content) {
assert(`an Ember.CollectionView's content must implement Ember.Array. You passed ${content}`, EmberArray.detect(content));
},
_assertArrayLike: function(content) {
Ember.assert(fmt("an Ember.CollectionView's content must implement Ember.Array. You passed %@", [content]), EmberArray.detect(content));
},
_assertArrayLike: function(content) {
Ember.assert(fmt("The value that #each loops over must be an Array. You " +
"passed %@, but it should have been an ArrayController",
[content.constructor]),
!ControllerMixin.detect(content) ||
(content && content.isGenerated) ||
content instanceof ArrayController);
Ember.assert(fmt("The value that #each loops over must be an Array. You passed %@",
[(ControllerMixin.detect(content) &&
content.get('model') !== undefined) ?
fmt("'%@' (wrapped in %@)", [content.get('model'), content]) : content]),
EmberArray.detect(content));
},
var A = function(arr) {
if (arr === undefined) { arr = []; }
return EmberArray.detect(arr) ? arr : NativeArray.apply(arr);
};
set(key, value) {
Ember.assert(
'ArrayController expects `model` to implement the Ember.Array mixin. ' +
'This can often be fixed by wrapping your model with `Ember.A()`.',
EmberArray.detect(value) || !value
);
return value;
}
}),
_assertArrayLike: function(content) {
Ember.assert(fmt("The value that #each loops over must be an Array. You " +
"passed %@, but it should have been an ArrayController",
[content.constructor]),
!ControllerMixin.detect(content) ||
(content && content.isGenerated) ||
content instanceof ArrayController);
Ember.assert(fmt("The value that #each loops over must be an Array. You passed %@",
[(ControllerMixin.detect(content) &&
content.get('model') !== undefined) ?
fmt("'%@' (wrapped in %@)", [content.get('model'), content]) : content]),
EmberArray.detect(content));
},