diff --git a/src/babel/transformation/transformers/other/flow.js b/src/babel/transformation/transformers/other/flow.js index 821336f65b..c5cb1e0631 100644 --- a/src/babel/transformation/transformers/other/flow.js +++ b/src/babel/transformation/transformers/other/flow.js @@ -13,6 +13,13 @@ export function Class(node) { node.implements = null; } +export function Function(node) { + for (var i = 0; i < node.params.length; i++) { + var param = node.params[i]; + param.optional = false; + } +} + export function TypeCastExpression(node) { return node.expression; } diff --git a/test/fixtures/transformation/flow/strip-type-annotations/expected.js b/test/fixtures/transformation/flow/strip-type-annotations/expected.js index 91f40a7778..62bf507aae 100644 --- a/test/fixtures/transformation/flow/strip-type-annotations/expected.js +++ b/test/fixtures/transformation/flow/strip-type-annotations/expected.js @@ -61,7 +61,7 @@ class Foo7 { class Foo8 { "bar"() {} } -function foo(requiredParam, optParam?) {} +function foo(requiredParam, optParam) {} class Foo9 {} class Foo10 {} var x = 4;