Skip to content

There are no option to no transform async/await #8838

New issue

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

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

Already on GitHub? # to your account

Closed
tetsuharuohzeki opened this issue May 26, 2016 · 2 comments
Closed

There are no option to no transform async/await #8838

tetsuharuohzeki opened this issue May 26, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@tetsuharuohzeki
Copy link
Contributor

TypeScript Version:

  • Version 1.9.0-dev.20160525-1.0

Code

// A self-contained demonstration of the problem follows...
async function getBar(params: number) {
    return 1;
}

transform into with --target ES6

Expected behavior:

  • Don't transform async/await with polyfill codes.
    • I would not like to transform async/awai in typescript phase, use babel or something to transform them, or use browser's natively support.
    • In this case, I'd like to use TypeScript compiler as a very nice type checker and down transform to ECMA262's latest standard syntax.

Actual behavior:

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments)).next());
    });
};
function getBar(params) {
    return __awaiter(this, void 0, void 0, function* () {
        return 1;
    });
}
@mhegazy
Copy link
Contributor

mhegazy commented May 26, 2016

I believe you asking for --t ESNext target. see #5361 (comment)

this is tracked bu #5361

@mhegazy mhegazy closed this as completed May 26, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label May 26, 2016
@tetsuharuohzeki
Copy link
Contributor Author

this is tracked bu #5361

Ah, okay. Thank you.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants