<p dir="auto">I have a bit of code that Babel 5 parses but 6 does not:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="      listenerPromise = async () =&gt; {
        // Wait for the other listeners to throw
        await Promise.resolve();
        expect(errorCount).toBe(2);
        await Promise.resolve();
        return 'success';
      }();"><pre class="notranslate">      <span class="pl-s1">listenerPromise</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-c">// Wait for the other listeners to throw</span>
        <span class="pl-k">await</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">errorCount</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">await</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">return</span> <span class="pl-s">'success'</span><span class="pl-kos">;</span>
      <span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">If I put parens around the async function expression (as in <code class="notranslate">listenerPromise = (async () =&gt; {})();</code>), then it successfully parses. I haven't looked at the grammar closely yet... anyone know if my original JS is even valid and Babel 5 was too lenient, or if this is a bug with Babel 6?</p>
<p dir="auto">Versions of Babel and plugins I'm using:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    &quot;babel-core&quot;: &quot;^6.1.2&quot;,
    &quot;babel-plugin-syntax-async-functions&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-syntax-flow&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-syntax-trailing-function-commas&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-transform-async-to-generator&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-transform-es2015-arrow-functions&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-transform-es2015-classes&quot;: &quot;^6.1.2&quot;,
    &quot;babel-plugin-transform-es2015-destructuring&quot;: &quot;^6.0.18&quot;,
    &quot;babel-plugin-transform-es2015-modules-commonjs&quot;: &quot;^6.1.3&quot;,
    &quot;babel-plugin-transform-es2015-parameters&quot;: &quot;^6.0.18&quot;,
    &quot;babel-plugin-transform-es2015-shorthand-properties&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-transform-es2015-spread&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-transform-flow-strip-types&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-transform-function-bind&quot;: &quot;^6.0.14&quot;,
    &quot;babel-plugin-transform-runtime&quot;: &quot;^6.1.2&quot;,
    &quot;babel-plugin-transform-strict-mode&quot;: &quot;^6.1.2&quot;,"><pre class="notranslate"><code class="notranslate">    "babel-core": "^6.1.2",
    "babel-plugin-syntax-async-functions": "^6.0.14",
    "babel-plugin-syntax-flow": "^6.0.14",
    "babel-plugin-syntax-trailing-function-commas": "^6.0.14",
    "babel-plugin-transform-async-to-generator": "^6.0.14",
    "babel-plugin-transform-es2015-arrow-functions": "^6.0.14",
    "babel-plugin-transform-es2015-classes": "^6.1.2",
    "babel-plugin-transform-es2015-destructuring": "^6.0.18",
    "babel-plugin-transform-es2015-modules-commonjs": "^6.1.3",
    "babel-plugin-transform-es2015-parameters": "^6.0.18",
    "babel-plugin-transform-es2015-shorthand-properties": "^6.0.14",
    "babel-plugin-transform-es2015-spread": "^6.0.14",
    "babel-plugin-transform-flow-strip-types": "^6.0.14",
    "babel-plugin-transform-function-bind": "^6.0.14",
    "babel-plugin-transform-runtime": "^6.1.2",
    "babel-plugin-transform-strict-mode": "^6.1.2",
</code></pre></div>
<p dir="auto">In Babel 5, it was possible to do this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="() =&gt; {
    console.log(&quot;test&quot;);
}();"><pre class="notranslate"><code class="notranslate">() =&gt; {
    console.log("test");
}();
</code></pre></div>
<p dir="auto">However, this is no longer possible in Babel 6 - it gives an "unexpected token" error.  Instead, I have to wrap the function as an expression:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(() =&gt; {
    console.log(&quot;test&quot;);
})();"><pre class="notranslate"><code class="notranslate">(() =&gt; {
    console.log("test");
})();
</code></pre></div>
<p dir="auto">I'm transpiling with the following Gulp task:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var gulp = require(&quot;gulp&quot;);
var browserify = require(&quot;browserify&quot;);
var buffer = require(&quot;vinyl-buffer&quot;);
var source = require(&quot;vinyl-source-stream&quot;);
var sourcemaps = require(&quot;gulp-sourcemaps&quot;);

gulp.task(&quot;js&quot;, function() {
    var bundler = browserify(&quot;src/app.js&quot;)
                .transform(&quot;babelify&quot;, {
                    presets: [&quot;es2015&quot;]
                });

    return bundler.bundle()
        .on(&quot;error&quot;, function(err) {
            console.error(err);
            this.emit(&quot;end&quot;);
        })
        .pipe(source(&quot;app.js&quot;))
        .pipe(buffer())
        .pipe(sourcemaps.init({ loadMaps: true }))
        .pipe(sourcemaps.write(&quot;./&quot;))
        .pipe(rename(&quot;dist/app.js&quot;))
        .pipe(gulp.dest(&quot;./&quot;));
});"><pre class="notranslate"><code class="notranslate">var gulp = require("gulp");
var browserify = require("browserify");
var buffer = require("vinyl-buffer");
var source = require("vinyl-source-stream");
var sourcemaps = require("gulp-sourcemaps");

gulp.task("js", function() {
    var bundler = browserify("src/app.js")
                .transform("babelify", {
                    presets: ["es2015"]
                });

    return bundler.bundle()
        .on("error", function(err) {
            console.error(err);
            this.emit("end");
        })
        .pipe(source("app.js"))
        .pipe(buffer())
        .pipe(sourcemaps.init({ loadMaps: true }))
        .pipe(sourcemaps.write("./"))
        .pipe(rename("dist/app.js"))
        .pipe(gulp.dest("./"));
});
</code></pre></div>
<p dir="auto">This script works fine with everything else, as long as I wrap my self-calling arrow functions in brackets.  Is this intentional, or is this a regression?</p>