Config config = new Config(new HashSet<String>(),
new HashSet<String>(), true, LanguageMode.ECMASCRIPT6, false);
// TODO(lpino): ParserRunner reports errors if the expression is not
// ES6 valid. We need to abort the validation of the type transformation
// whenever an error is reported.
ParseResult result = ParserRunner.parse(
sourceFile, typeTransformationString, config, errorReporter);
Node ast = result.ast;
// Check that the expression is a script with an expression result
if (!ast.isScript() || !ast.getFirstChild().isExprResult()) {
warnInvalidExpression("type transformation", ast);