Skip to content

Commit

Permalink
fix(compiler): fix transpiled ES5 code
Browse files Browse the repository at this point in the history
fixes angular#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
  • Loading branch information
vicb committed Dec 8, 2016
1 parent 1b54788 commit 002927e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/@angular/compiler/src/jit/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 002927e

Please sign in to comment.