shapesecurity / shift-parser-js

ECMAScript parser that produces a Shift format AST
http://shift-ast.org/parser.html
Apache License 2.0
251 stars 28 forks source link

"await" should not be allowed as a default expression #419

Closed Shilpi3 closed 5 years ago

Shilpi3 commented 5 years ago

Following scripts should throw error

async function a(k = await 3) {},
async function a() { async function b(k = await 3) {} },
async function a() { async function b(k = [await 3]) {} },

async function a() { async function b([k = await 3]) {} },
async function a() { async function b([k = [await 3]]) {} },
async function a() { async function b({k = await 3}) {} },
async function a() { async function b({k = [await 3]}) {} },
Shilpi3 commented 5 years ago

They are all early errors