Prevent creation of empty entry in _connectorCache for raw templates. (#4296)

This commit is contained in:
acshi 2016-06-29 10:59:48 -04:00 committed by Robin Ward
parent e4074f75b1
commit deda9a6908

View file

@ -86,13 +86,12 @@ function buildConnectorCache() {
});
findOutlets(Ember.TEMPLATES, function(outletName, resource, uniqueName) {
_connectorCache[outletName] = _connectorCache[outletName] || [];
const mixin = {templateName: resource.replace('javascripts/', '')};
let viewClass = uniqueViews[uniqueName];
if (viewClass) {
// We are going to add it back with the proper template
_connectorCache[outletName] = _connectorCache[outletName] || [];
_connectorCache[outletName].removeObject(viewClass);
} else {
if (!/\.raw$/.test(uniqueName)) {
@ -101,6 +100,7 @@ function buildConnectorCache() {
}
if (viewClass) {
_connectorCache[outletName] = _connectorCache[outletName] || [];
_connectorCache[outletName].pushObject(viewClass.extend(mixin));
} else {
// we have a raw template