Results 1 to 3 of 3

Thread: Async/Await support

  1. #1
    Sencha User
    Join Date
    Mar 2015
    Posts
    34

    Default Async/Await support

    Does CMD 6.5.+ support the new async/await keywords? I know they aren't in ES6 but other browsers and transpilers have added support already.

  2. #2
    Sencha User
    Join Date
    Mar 2015
    Posts
    34

    Default

    I just tested this and it does seem to transpile async/await functions. Original function:

    Code:
    async add1(x) {
            var a = resolveAfter2Seconds(20);
            var b = resolveAfter2Seconds(30);
            return x + await a + await b;
        },
    Transpiled to:
    Code:
    add1: function (a) {
            function $jscomp$async$generator() {
                var b = 0;
                var f;
                var d;
                var e;
                var c;
                var i;
                var h;
                function $jscomp$generator$impl(j, g) {
                    while (1) {
                        switch (b) {
                        case 0:
                            h = resolveAfter2Seconds(20);
                            i = resolveAfter2Seconds(30);
                            c = a;
                            b = 1;
                            return {
                                value: h,
                                done: !1
                            };
                        case 1:
                            if (!(g !== undefined)) {
                                b = 2;
                                break
                            };
                            b = -1;
                            throw g;
                        case 2:
                            e = j;
                            d = c + e;
                            b = 3;
                            return {
                                value: i,
                                done: !1
                            };
                        case 3:
                            if (!(g !== undefined)) {
                                b = 4;
                                break
                            };
                            b = -1;
                            throw g;
                        case 4:
                            f = j;
                            b = -1;
                            return {
                                value: d + f,
                                done: !0
                            };
                            b = -1;
                        default:
                            return {
                                value: undefined,
                                done: !0
                            };
                        }
                    }
                }
                var g = {
                    next: function (b) {
                        return $jscomp$generator$impl(b, undefined)
                    },
                    'throw': function (b) {
                        return $jscomp$generator$impl(undefined, b)
                    },
                    'return': function (b) {
                        throw Error('Not yet implemented')
                    }
                };
                $jscomp.initSymbolIterator();
                g[Symbol.iterator] = function () {
                    return this
                };
                return g
            }
            return $jscomp.executeAsyncGenerator($jscomp$async$generator())
        },

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2014
    Location
    New Jersey
    Posts
    166

    Default

    I'm bumping up this post. I'd like to know this as well.

    Can someone from Sencha comment on this? Is there any support for ES7/ES8 in Sencha Cmd 6.5.1?

Similar Threads

  1. Replies: 3
    Last Post: 6 Jun 2017, 11:41 PM
  2. Replies: 4
    Last Post: 19 Apr 2016, 9:36 AM
  3. what changes are to await if google chrome changes to blink engine
    By dschano in forum Sencha Touch 2.x: Discussion
    Replies: 3
    Last Post: 31 May 2013, 5:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •