Remove flow

This commit is contained in:
Sam Goldman
2016-03-01 21:02:55 -08:00
parent f4197cc77b
commit 2827ff6b01
75 changed files with 278 additions and 542 deletions

View File

@@ -22,7 +22,7 @@ let buildCutOff = template(`
`);
function hasDefaults(node) {
for (let param of (node.params: Array<Object>)) {
for (let param of node.params) {
if (!t.isIdentifier(param)) return true;
}
return false;

View File

@@ -2,7 +2,7 @@ import * as t from "babel-types";
export let visitor = {
Function(path) {
let params: Array = path.get("params");
let params = path.get("params");
// If there's a rest param, no need to loop through it. Also, we need to
// hoist one more level to get `declar` at the right spot.

View File

@@ -1,4 +1,3 @@
import type { NodePath } from "babel-traverse";
import { visitors } from "babel-traverse";
import * as destructuring from "./destructuring";
@@ -10,7 +9,7 @@ export default function () {
visitor: visitors.merge([{
ArrowFunctionExpression(path) {
// default/rest visitors require access to `arguments`
let params: Array<NodePath> = path.get("params");
let params = path.get("params");
for (let param of params) {
if (param.isRestElement() || param.isAssignmentPattern()) {
path.arrowFunctionToShadowed();

View File

@@ -198,7 +198,7 @@ export let visitor = {
// There are only "shorthand" references
if (!state.deopted && !state.references.length) {
for (let {path, cause} of (state.candidates: Array)) {
for (let {path, cause} of state.candidates) {
switch (cause) {
case "indexGetter":
optimiseIndexGetter(path, argsId, state.offset);