fix(compiler): fix transpiled ES5 code (#13322)
fixes #13301 The inner class would transpile to a nested function declaration which is not allowed in ES5. See http://eslint.org/docs/rules/no-inner-declarations
This commit is contained in:
parent
1b547886d0
commit
4398056146
|
@ -213,11 +213,11 @@ export class JitCompiler implements Compiler {
|
||||||
const compMeta = this._metadataResolver.getDirectiveMetadata(compType);
|
const compMeta = this._metadataResolver.getDirectiveMetadata(compType);
|
||||||
assertComponent(compMeta);
|
assertComponent(compMeta);
|
||||||
|
|
||||||
class HostClass {
|
const hostClass = {
|
||||||
static overriddenName = `${identifierName(compMeta.type)}_Host`;
|
overriddenName: `${identifierName(compMeta.type)}_Host`,
|
||||||
}
|
};
|
||||||
|
|
||||||
const hostMeta = createHostComponentMeta(HostClass, compMeta);
|
const hostMeta = createHostComponentMeta(hostClass, compMeta);
|
||||||
compiledTemplate = new CompiledTemplate(
|
compiledTemplate = new CompiledTemplate(
|
||||||
true, compMeta.selector, compMeta.type, hostMeta, ngModule, [compMeta.type]);
|
true, compMeta.selector, compMeta.type, hostMeta, ngModule, [compMeta.type]);
|
||||||
this._compiledHostTemplateCache.set(compType, compiledTemplate);
|
this._compiledHostTemplateCache.set(compType, compiledTemplate);
|
||||||
|
|
Loading…
Reference in New Issue