Skip to content

Can't use const in a for-of loop #468

@ivan

Description

@ivan

With this constfail.js:

"use strict";

const ok = 3;

for(const x of [1, 2]) {
        console.log(x);
}

flow breaks on the const in the for-of loop:

# cat constfail.js | flow check-contents

-:5:5,9: Unexpected token const

Found 1 error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions