Fix rest parameters with flow type casting (#4636)

Do not skip TypeCastExpressions when finding referenced identifiers as the
type cast contains valid non flow code that we need to visit.
This commit is contained in:
Daniel Tschinder
2016-10-01 18:58:14 +02:00
committed by Henry Zhu
parent fe2b9d73ed
commit 16716ea3de
4 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
let oneOf = (...nodes) => {
if (nodes.length === 1) {
return nodes[0];
}
return ((new OneOfNode(nodes)): any)
}

View File

@@ -0,0 +1,10 @@
let oneOf = function () {
for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
nodes[_key] = arguments[_key];
}
if (nodes.length === 1) {
return nodes[0];
}
return new OneOfNode(nodes);
};

View File

@@ -0,0 +1,3 @@
{
"plugins": ["syntax-flow", "transform-flow-strip-types", "transform-es2015-parameters", "transform-es2015-destructuring", "transform-es2015-arrow-functions"]
}