From 43980561467b705516940a9cf32610ccf6c84585 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 8 Dec 2016 15:02:59 -0800 Subject: [PATCH] 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 --- modules/@angular/compiler/src/jit/compiler.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/@angular/compiler/src/jit/compiler.ts b/modules/@angular/compiler/src/jit/compiler.ts index 5ef6c022f9..4e4e3de69c 100644 --- a/modules/@angular/compiler/src/jit/compiler.ts +++ b/modules/@angular/compiler/src/jit/compiler.ts @@ -213,11 +213,11 @@ export class JitCompiler implements Compiler { const compMeta = this._metadataResolver.getDirectiveMetadata(compType); assertComponent(compMeta); - class HostClass { - static overriddenName = `${identifierName(compMeta.type)}_Host`; - } + const hostClass = { + overriddenName: `${identifierName(compMeta.type)}_Host`, + }; - const hostMeta = createHostComponentMeta(HostClass, compMeta); + const hostMeta = createHostComponentMeta(hostClass, compMeta); compiledTemplate = new CompiledTemplate( true, compMeta.selector, compMeta.type, hostMeta, ngModule, [compMeta.type]); this._compiledHostTemplateCache.set(compType, compiledTemplate);