feat(ivy): add an IVY local the compiler which avoids analyzeModule (#23441)

closes #23289

Based on a spike by @chukjaz

PR Close #23441
This commit is contained in:
Victor Berchet
2018-04-18 16:23:49 -07:00
parent a19e018439
commit 9757347e71
17 changed files with 1058 additions and 464 deletions

View File

@ -15,18 +15,18 @@ import {OutputContext} from '../util';
import {Identifiers as R3} from './r3_identifiers';
const EMPTY_ARRAY = o.literalArr([]);
function convertMetaToOutput(meta: any, ctx: OutputContext): o.Expression {
if (Array.isArray(meta)) {
return o.literalArr(meta.map(entry => convertMetaToOutput(entry, ctx)));
} else if (meta instanceof StaticSymbol) {
return ctx.importExpr(meta);
} else if (meta == null) {
return o.literal(meta);
} else {
throw new Error(`Internal error: Unsupported or unknown metadata: ${meta}`);
}
if (meta instanceof StaticSymbol) {
return ctx.importExpr(meta);
}
if (meta == null) {
return o.literal(meta);
}
throw new Error(`Internal error: Unsupported or unknown metadata: ${meta}`);
}
export function compileNgModule(