Implement NonNullExpressions in CocoJS
This is there for static typechecking, and so we can safely erase it.
@@ -2439,6 +2439,8 @@ export class Transformer {
return this.transformFunctionExpression(<ts.FunctionExpression>node);
case ts.SyntaxKind.Identifier:
return await this.transformIdentifierExpression(<ts.Identifier>node);
+ case ts.SyntaxKind.NonNullExpression:
+ return await this.transformNonNullExpression(<ts.NonNullExpression>node);
case ts.SyntaxKind.ObjectLiteralExpression:
return this.transformObjectLiteralExpression(<ts.ObjectLiteralExpression>node);
case ts.SyntaxKind.PostfixUnaryExpression:
@@ -2732,6 +2734,10 @@ export class Transformer {
return notYetImplemented(node);
}
+ private async transformNonNullExpression(node: ts.NonNullExpression): Promise<ast.Expression> {
+ return await this.transformExpression(node.expression);
+ }
+
private async transformObjectLiteralExpression(node: ts.ObjectLiteralExpression): Promise<ast.ObjectLiteral> {
// TODO[pulumi/mu#46]: because TypeScript object literals are untyped, it's not clear what NutIL type this
// expression should produce. It's common for a TypeScript literal to be enclosed in a cast, for example,
