Skip to content

Unexpected step over/into behavior in files using async/await #5888

Closed
@BigDataSamuli

Description

@BigDataSamuli

Using VS 2015 Update 1 and TypeScript 1.7.4, I create a new "HTML Application with TypeScript", set ECMAScript version to ES6 in project properties, and replace app.ts with the following:

async function makeAsync(n: number) {
    return n;
}

async function doAsync() {
    var n1 = await makeAsync(10);
    var n2 = await makeAsync(5);

    return n1 + n2;
}

doAsync().then(x => console.log(x));

Running the program in Chrome, setting a breakpoint at the first await line, and refreshing the page causes the debugger to stop at the correct line. After pressing F10 (step over), however, the execution jumps to the closing brace of the doAsync function, while I'd expect it to jump to the next line. The next step over takes me into the generated app.js file, inside the __awaiter function.

The behavior is the same in an NTVS console application, except that instead of jumping to the js file, the execution cursor jumps around in the ts file in a seemingly random pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions