feat(ExpressionParser): add support for this

This commit is contained in:
Victor Berchet
2016-08-04 10:14:44 -07:00
committed by Alex Rickabaugh
parent 26c9e1dc70
commit 0ca05eee45
9 changed files with 75 additions and 23 deletions

View File

@ -21,6 +21,7 @@ class _ValueOutputAstTransformer implements ValueTransformer {
visitArray(arr: any[], type: o.Type): o.Expression {
return o.literalArr(arr.map(value => visitValue(value, this, null)), type);
}
visitStringMap(map: {[key: string]: any}, type: o.MapType): o.Expression {
var entries: Array<string|o.Expression>[] = [];
StringMapWrapper.forEach(map, (value: any, key: string) => {
@ -28,7 +29,9 @@ class _ValueOutputAstTransformer implements ValueTransformer {
});
return o.literalMap(entries, type);
}
visitPrimitive(value: any, type: o.Type): o.Expression { return o.literal(value, type); }
visitOther(value: any, type: o.Type): o.Expression {
if (value instanceof CompileIdentifierMetadata) {
return o.importExpr(value);