ASYNC_FOR_IN_WRONG_CONTEXT constant

CompileTimeErrorCode const ASYNC_FOR_IN_WRONG_CONTEXT

17.6.3 Asynchronous For-in: It is a compile-time error if an asynchronous for-in statement appears inside a synchronous function.

Implementation

static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT =
    CompileTimeErrorCode('ASYNC_FOR_IN_WRONG_CONTEXT',
        "The async for-in can only be used in an async function.",
        correction:
            "Try marking the function body with either 'async' or 'async*', "
            "or removing the 'await' before the for loop.")