Skip to content

Refactored code that uses ASI is borked #37813

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Found from #37814.

function foo() {
    [|var x: number

    x = 10;
    return x;|]
}

Extract [| this range |] to a function in the global scope.

Expected:

function foo() {
    return yadda();
}

function yadda() {
    var x: number;
    
    x = 10;
    return x;
}

or

function foo() {
    return yadda();
}

function yadda() {
    var x: number
    
    x = 10;
    return x;
}

Actual:

function foo() {
    return yadda();
}

function yadda() {
    var x: number

        ;

    x = 10;
    return x;
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbolFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions