ratel-core icon indicating copy to clipboard operation
ratel-core copied to clipboard

[WIP] Support keyword async

Open LuoZijun opened this issue 6 years ago • 0 comments

Resolve issue: #109

Should pass:


// https://www.ecma-international.org/ecma-262/9.0/index.html#sec-async-function-definitions
async function foo0(){ }

// https://www.ecma-international.org/ecma-262/9.0/index.html#sec-async-generator-function-definitions
async function* foo1(){ }

// https://www.ecma-international.org/ecma-262/9.0/index.html#prod-MethodDefinition
// https://www.ecma-international.org/ecma-262/9.0/index.html#prod-AsyncMethod
class Cls {
    async foo() { }
    static async foo1() { }
}
// https://www.ecma-international.org/ecma-262/9.0/index.html#prod-AsyncGeneratorMethod
class Cls {
    async* foo() { }
    static async* foo1() { }
}

// https://www.ecma-international.org/ecma-262/9.0/index.html#sec-async-arrow-function-definitions
async a => {};
async a => a
async (a, b) => {}
async (a, b) => a

LuoZijun avatar Feb 26 '19 21:02 LuoZijun