use of com.github.anba.es6draft.ast.AsyncGeneratorDefinition in project es6draft by anba.
the class ScriptLoader method asyncGenerator.
/**
* Parses and compiles the javascript async generator.
*
* @param source
* the script source descriptor
* @param formals
* the formal parameters
* @param bodyText
* the async generator body
* @return the compiled async generator
* @throws ParserException
* if the source contains any syntax errors
* @throws CompilationException
* if the parsed source could not be compiled
*/
public CompiledFunction asyncGenerator(Source source, String formals, String bodyText) throws ParserException, CompilationException {
Parser parser = new Parser(context, source);
AsyncGeneratorDefinition asyncDef = parser.parseAsyncGenerator(formals, bodyText);
return compile(asyncDef, nextFunctionName());
}
Aggregations