Skip to content

Svelte compiler removes semicolon after while, changing logic #6884

@mustafa0x

Description

@mustafa0x
function fn() { let i = 1; while (++i < 100); return i; }

Compiles to:

function fn() { let i = 1; while (++i < 100) // No semicolon! return i; }

causing fn() to give 2 instead of 100.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompilerChanges relating to the compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions