Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2053610429 | ||
|
|
cd4f83b299 | ||
|
|
ec29ba19a9 | ||
|
|
9dc03e0978 | ||
|
|
bc4258eca9 | ||
|
|
b0e58f9770 | ||
|
|
a1e2641c91 |
@@ -13,6 +13,11 @@ _Note: Gaps between patch versions are faulty/broken releases._
|
||||
|
||||
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
|
||||
|
||||
## 5.5.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix weird state bug when traversing overa `node` `ClassProperty` instead of `path` in the `es6.classes` transformer.
|
||||
|
||||
## 5.5.2
|
||||
|
||||
* **Bug Fix**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-core",
|
||||
"description": "A compiler for writing next generation JavaScript",
|
||||
"version": "5.5.2",
|
||||
"version": "5.5.3",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "babel",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.5.1",
|
||||
"version": "5.5.2",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"repository": "babel/babel",
|
||||
"preferGlobal": true,
|
||||
"dependencies": {
|
||||
"babel-core": "^5.5.1",
|
||||
"babel-core": "^5.5.2",
|
||||
"chokidar": "^1.0.0",
|
||||
"commander": "^2.6.0",
|
||||
"convert-source-map": "^1.1.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-runtime",
|
||||
"description": "babel selfContained runtime",
|
||||
"version": "5.5.1",
|
||||
"version": "5.5.2",
|
||||
"license": "MIT",
|
||||
"repository": "babel/babel",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
|
||||
@@ -293,7 +293,7 @@ class ClassTransformer {
|
||||
this.pushMethod(node, path);
|
||||
}
|
||||
} else if (t.isClassProperty(node)) {
|
||||
this.pushProperty(node);
|
||||
this.pushProperty(node, path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,8 +478,8 @@ class ClassTransformer {
|
||||
* Description
|
||||
*/
|
||||
|
||||
pushProperty(node: { type: "ClassProperty" }) {
|
||||
this.scope.traverse(node, collectPropertyReferencesVisitor, {
|
||||
pushProperty(node: { type: "ClassProperty" }, path: NodePath) {
|
||||
path.traverse(collectPropertyReferencesVisitor, {
|
||||
references: this.instancePropRefs,
|
||||
scope: this.scope
|
||||
});
|
||||
|
||||
@@ -190,6 +190,10 @@ export function _inferTypeAnnotation(force?: boolean): ?Object {
|
||||
return t.genericTypeAnnotation(t.identifier("Function"));
|
||||
}
|
||||
|
||||
if (path.isTemplateLiteral()) {
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
if (path.isUnaryExpression()) {
|
||||
let operator = node.operator;
|
||||
|
||||
@@ -273,8 +277,11 @@ export function _inferTypeAnnotation(force?: boolean): ?Object {
|
||||
if (node.regex) return t.genericTypeAnnotation(t.identifier("RegExp"));
|
||||
}
|
||||
|
||||
if (path.isCallExpression()) {
|
||||
var callee = path.get("callee").resolve();
|
||||
var callPath;
|
||||
if (path.isCallExpression()) callPath = path.get("callee");
|
||||
if (path.isTaggedTemplateExpression()) callPath = path.get("tag");
|
||||
if (callPath) {
|
||||
var callee = callPath.resolve();
|
||||
// todo: read typescript/flow interfaces
|
||||
if (callee.isNodeType("Function")) return callee.node.returnType;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
for (var key in foo) {
|
||||
break;
|
||||
foo();
|
||||
}
|
||||
|
||||
function bar() {
|
||||
yes();
|
||||
bar();
|
||||
return "wow";
|
||||
nomore();
|
||||
}
|
||||
|
||||
bar();
|
||||
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
for (var key in foo) {
|
||||
break;
|
||||
}
|
||||
|
||||
function bar() {
|
||||
yes();
|
||||
bar();
|
||||
return "wow";
|
||||
}
|
||||
|
||||
bar();
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"experimental": true,
|
||||
"externalHelpers": true,
|
||||
"noCheckAst": true,
|
||||
"blacklist": ["regenerator"],
|
||||
|
||||
Reference in New Issue
Block a user