Merge pull request #5399 from babel/update-babylon-beta-4
Update babylon beta 4
This commit is contained in:
commit
65f23b8212
@ -6,6 +6,7 @@ packages/*/node_modules
|
||||
packages/*/lib
|
||||
packages/*/dist
|
||||
packages/*/test/fixtures
|
||||
packages/*/test/tmp
|
||||
vendor
|
||||
_babel.github.io
|
||||
Gulpfile.js
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
"babel-register": "^6.23.0",
|
||||
"babel-traverse": "^6.23.1",
|
||||
"babel-types": "^6.23.0",
|
||||
"babylon": "7.0.0-beta.3",
|
||||
"babylon": "7.0.0-beta.4",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"debug": "^2.1.1",
|
||||
"json5": "^0.5.0",
|
||||
|
||||
@ -21,6 +21,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-helper-fixtures": "^6.22.0",
|
||||
"babylon": "7.0.0-beta.3"
|
||||
"babylon": "7.0.0-beta.4"
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,6 +146,23 @@ function plainFunction(path: NodePath, callId: Object) {
|
||||
]);
|
||||
declar._blockHoist = true;
|
||||
|
||||
if (path.parentPath.isExportDefaultDeclaration()) {
|
||||
// change the path type so that replaceWith() does not wrap
|
||||
// the identifier into an expressionStatement
|
||||
path.parentPath.insertBefore(declar);
|
||||
path.parentPath.replaceWith(
|
||||
t.exportNamedDeclaration(null,
|
||||
[
|
||||
t.exportSpecifier(
|
||||
t.identifier(asyncFnId.name),
|
||||
t.identifier("default")
|
||||
)
|
||||
]
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
path.replaceWith(declar);
|
||||
} else {
|
||||
const retFunction = container.body.body[1].argument;
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export default async () => { return await foo(); }
|
||||
@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = babelHelpers.asyncToGenerator(function* () {
|
||||
return yield foo();
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
export default async function myFunc() {}
|
||||
@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
let myFunc = (() => {
|
||||
var _ref = babelHelpers.asyncToGenerator(function* () {});
|
||||
|
||||
return function myFunc() {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
})();
|
||||
|
||||
exports.default = myFunc;
|
||||
@ -8,7 +8,7 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-template",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"babylon": "7.0.0-beta.3",
|
||||
"babylon": "7.0.0-beta.4",
|
||||
"babel-traverse": "^6.23.0",
|
||||
"babel-types": "^6.23.0",
|
||||
"lodash": "^4.2.0"
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"babel-code-frame": "^6.22.0",
|
||||
"babel-messages": "^6.23.0",
|
||||
"babel-types": "^6.23.0",
|
||||
"babylon": "7.0.0-beta.3",
|
||||
"babylon": "7.0.0-beta.4",
|
||||
"debug": "^2.2.0",
|
||||
"globals": "^9.0.0",
|
||||
"invariant": "^2.2.0",
|
||||
|
||||
@ -13,6 +13,6 @@
|
||||
"to-fast-properties": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babylon": "7.0.0-beta.3"
|
||||
"babylon": "7.0.0-beta.4"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user