Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BigDataSamuli opened this issue Dec 2, 2015 · 2 comments
Closed

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

BigDataSamuli opened this issue Dec 2, 2015 · 2 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@BigDataSamuli
Copy link

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.

@weswigham
Copy link
Member

This is because of a bug in chrome/v8 which prevents it from stepping over generators correctly. Track this bug in the chromium bug tracker.

@mhegazy mhegazy added the External Relates to another program, environment, or user action which we cannot control. label Dec 2, 2015
@mhegazy mhegazy closed this as completed Dec 2, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Dec 2, 2015

thanks @weswigham

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

3 participants