fix(compiler): minor cleanups and fixes

Part of #3605
This commit is contained in:
Tobias Bosch
2015-09-18 10:33:23 -07:00
parent 9c9769047d
commit 0ed6fc4f6b
4 changed files with 25 additions and 8 deletions

View File

@ -212,6 +212,15 @@ export function main() {
});
describe('normalizeDirectiveMetadata', () => {
it('should return the given DirectiveMetadata for non components',
inject([AsyncTestCompleter], (async) => {
var meta = runtimeMetadataResolver.getMetadata(NonComponent);
compiler.normalizeDirectiveMetadata(meta).then(normMeta => {
expect(normMeta).toBe(meta);
async.done();
});
}));
it('should normalize the template',
inject([AsyncTestCompleter, XHR], (async, xhr: MockXHR) => {
xhr.expect('angular2/test/compiler/compUrl.html', 'loadedTemplate');
@ -323,10 +332,14 @@ export function humanizeTemplate(template: CompiledTemplate,
}
var commands = [];
var templateData = template.dataGetter();
result =
{'styles': templateData[2], 'commands': commands, 'cd': testChangeDetector(templateData[0])};
result = {
'styles': CompiledTemplate.getSylesFromData(templateData),
'commands': commands,
'cd': testChangeDetector(CompiledTemplate.getChangeDetectorFromData(templateData))
};
humanizedTemplates.set(template.id, result);
visitAllCommands(new CommandHumanizer(commands, humanizedTemplates), templateData[1]);
visitAllCommands(new CommandHumanizer(commands, humanizedTemplates),
CompiledTemplate.getCommandsFromData(templateData));
return result;
}