Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
' http://emberjs.com/guides/deprecations#toc_global-lookup-of-views', !globalViewClass);
if (globalViewClass) {
viewClass = globalViewClass;
}
}
} else {
viewClass = path;
}
// Sometimes a view's value is yet another path
if ('string' === typeof viewClass && data && data.view) {
viewClass = handlebarsGetView(data.view, viewClass, container, data);
}
Ember.assert(
fmt(path+" must be a subclass of Ember.View, not %@", [viewClass]),
View.detect(viewClass)
);
return viewClass;
}
var itemHash = {};
var match;
// Extract item view class if provided else default to the standard class
var collectionPrototype = collectionClass.proto();
var itemViewClass;
if (hash.itemView) {
itemViewClass = handlebarsGetView(this, hash.itemView, container, options.data);
} else if (hash.itemViewClass) {
itemViewClass = handlebarsGetView(collectionPrototype, hash.itemViewClass, container, options.data);
} else {
itemViewClass = handlebarsGetView(collectionPrototype, collectionPrototype.itemViewClass, container, options.data);
}
Ember.assert(fmt("%@ #collection: Could not find itemViewClass %@", [data.view, itemViewClass]), !!itemViewClass);
delete hash.itemViewClass;
delete hash.itemView;
// Go through options passed to the {{collection}} helper and extract options
// that configure item views instead of the collection itself.
for (var prop in hash) {
if (hash.hasOwnProperty(prop)) {
match = prop.match(/^item(.)(.*)$/);
if (match && prop !== 'itemController') {
// Convert itemShouldFoo -> shouldFoo
itemHash[match[1].toLowerCase() + match[2]] = hash[prop];
// Delete from hash as this will end up getting passed to the
// {{view}} helper method.
delete hash[prop];
'that you created a view manually, instead of through the ' +
'container. Instead, use container.lookup("view:viewName"), ' +
'which will properly instantiate your view.',
controller && controller.container);
container = controller.container;
itemViewClass = container.lookupFactory('view:' + hash.itemView);
Ember.assert('You specified the itemView ' + hash.itemView + ", but it was " +
"not found at " + container.describe("view:" + hash.itemView) +
" (and it was not registered in the container)", !!itemViewClass);
} else if (hash.itemViewClass) {
itemViewClass = handlebarsGet(collectionPrototype, hash.itemViewClass, options);
} else {
itemViewClass = collectionPrototype.itemViewClass;
}
Ember.assert(fmt("%@ #collection: Could not find itemViewClass %@", [data.view, itemViewClass]), !!itemViewClass);
delete hash.itemViewClass;
delete hash.itemView;
// Go through options passed to the {{collection}} helper and extract options
// that configure item views instead of the collection itself.
for (var prop in hash) {
if (hash.hasOwnProperty(prop)) {
match = prop.match(/^item(.)(.*)$/);
if (match && prop !== 'itemController') {
// Convert itemShouldFoo -> shouldFoo
itemHash[match[1].toLowerCase() + match[2]] = hash[prop];
// Delete from hash as this will end up getting passed to the
// {{view}} helper method.
delete hash[prop];
setUnknownProperty(key, value) {
var m = meta(this);
if (m.proto === this) {
// if marked as prototype then just defineProperty
// rather than delegate
defineProperty(this, key, null, value);
return value;
}
var content = get(this, 'content');
Ember.assert(fmt("Cannot delegate set('%@', %@) to the 'content' property of" +
" object proxy %@: its 'content' is undefined.", [key, value, this]), content);
Ember.deprecate(
fmt('You attempted to set `%@` from `%@`, but object proxying is deprecated. ' +
'Please use `model.%@` instead.', [key, this, key]),
!this.isController,
{ url: 'http://emberjs.com/guides/deprecations/#toc_objectcontroller' }
);
return set(content, key, value);
}
lazyValue.subscribe(view._wrapAsScheduled(function applyAttributeBindings() {
var result = lazyValue.value();
Ember.assert(fmt("Attributes must be numbers, strings or booleans, not %@", [result]),
result === null || result === undefined || typeof result === 'number' ||
typeof result === 'string' || typeof result === 'boolean');
var elem = view.$("[data-bindattr-" + dataId + "='" + dataId + "']");
Ember.assert("An attribute binding was triggered when the element was not in the DOM", elem && elem.length !== 0);
View.applyAttributeBindings(elem, attr, result);
}));
_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));
},
appendChild: function() {
throw new EmberError(fmt(destroyingError, ['appendChild']));
},
rerender: function() {
}
var attrKeys = keys(hash);
var attr, path, lazyValue, attrView;
for (var i=0, l=attrKeys.length;i
_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));
},
loadedParams: computed('resolvedParams', function computeLinkViewRouteArgs() {
var router = get(this, 'router');
if (!router) { return; }
var resolvedParams = get(this, 'resolvedParams');
var namedRoute = resolvedParams.targetRouteName;
if (!namedRoute) { return; }
Ember.assert(fmt("The attempt to link-to route '%@' failed. " +
"The router did not find '%@' in its possible routes: '%@'",
[namedRoute, namedRoute, keys(router.router.recognizer.names).join("', '")]),
router.hasRoute(namedRoute));
if (!paramsAreLoaded(resolvedParams.models)) { return; }
return resolvedParams;
}),