use of com.google.javascript.jscomp.parsing.parser.trees.DynamicImportTree in project closure-compiler by google.
the class Parser method parseDynamicImportExpression.
// https://tc39.github.io/proposal-dynamic-import
private DynamicImportTree parseDynamicImportExpression() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.IMPORT);
if (peek(TokenType.QUESTION_DOT)) {
// import?.() not allowed
reportError("Optional chaining is forbidden in import?.");
}
eat(TokenType.OPEN_PAREN);
ParseTree argument = parseAssignmentExpression();
eat(TokenType.CLOSE_PAREN);
recordFeatureUsed(Feature.DYNAMIC_IMPORT);
return new DynamicImportTree(getTreeLocation(start), argument);
}
Aggregations