fix(compiler): strip <script> tag from templates

Fixes #2766
Closes #3486
This commit is contained in:
Pawel Kozlowski
2015-08-05 16:35:59 +02:00
parent 339071cb07
commit 748c2d6c97
3 changed files with 39 additions and 2 deletions
@@ -131,6 +131,16 @@ export function runCompilerCommonTests() {
});
}));
it('should remove script tags from templates', inject([AsyncTestCompleter], (async) => {
var compiler = createCompiler(EMPTY_STEP);
compiler.compile(new ViewDefinition(
{componentId: 'someId', template: '<div></div><script></script>'}))
.then((protoView) => {
expect(DOM.getInnerHTML(templateRoot(protoView))).toEqual('<div></div>');
async.done();
});
}));
it('should report loading errors', inject([AsyncTestCompleter], (async) => {
var compiler = createCompiler(EMPTY_STEP, null, new Map());
PromiseWrapper.catchError(