From e5dbb5bcf18100b36b48bc4bd13ee2ddfe932298 Mon Sep 17 00:00:00 2001 From: Kevin Barabash Date: Sat, 18 May 2019 18:51:38 -0400 Subject: [PATCH] Fixes #40, function and method overloading --- test/fixtures/convert/declare/declare-function/flow.js | 2 +- test/fixtures/convert/declare/declare-function/ts.js | 2 +- test/fixtures/convert/declare/function-overloading/flow.js | 3 +++ test/fixtures/convert/declare/function-overloading/ts.js | 3 +++ test/fixtures/convert/declare/method-overloading/flow.js | 6 ++++++ test/fixtures/convert/declare/method-overloading/ts.js | 6 ++++++ 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/convert/declare/function-overloading/flow.js create mode 100644 test/fixtures/convert/declare/function-overloading/ts.js create mode 100644 test/fixtures/convert/declare/method-overloading/flow.js create mode 100644 test/fixtures/convert/declare/method-overloading/ts.js diff --git a/test/fixtures/convert/declare/declare-function/flow.js b/test/fixtures/convert/declare/declare-function/flow.js index 363eda0..b13ce04 100644 --- a/test/fixtures/convert/declare/declare-function/flow.js +++ b/test/fixtures/convert/declare/declare-function/flow.js @@ -1,3 +1,3 @@ // @flow // Adds two numbers -declare function foo(a: number, b: number): number; +declare function foo(number, number): number; diff --git a/test/fixtures/convert/declare/declare-function/ts.js b/test/fixtures/convert/declare/declare-function/ts.js index d93b654..ca05894 100644 --- a/test/fixtures/convert/declare/declare-function/ts.js +++ b/test/fixtures/convert/declare/declare-function/ts.js @@ -1,3 +1,3 @@ // Adds two numbers -declare function foo(a: number, b: number): number; \ No newline at end of file +declare function foo(arg0: number, arg1: number): number; \ No newline at end of file diff --git a/test/fixtures/convert/declare/function-overloading/flow.js b/test/fixtures/convert/declare/function-overloading/flow.js new file mode 100644 index 0000000..d75bb4b --- /dev/null +++ b/test/fixtures/convert/declare/function-overloading/flow.js @@ -0,0 +1,3 @@ +// @flow +declare function getWidget(n: number): Widget; +declare function getWidget(s: string): Widget[]; diff --git a/test/fixtures/convert/declare/function-overloading/ts.js b/test/fixtures/convert/declare/function-overloading/ts.js new file mode 100644 index 0000000..fefc5c0 --- /dev/null +++ b/test/fixtures/convert/declare/function-overloading/ts.js @@ -0,0 +1,3 @@ + +declare function getWidget(n: number): Widget; +declare function getWidget(s: string): Widget[]; \ No newline at end of file diff --git a/test/fixtures/convert/declare/method-overloading/flow.js b/test/fixtures/convert/declare/method-overloading/flow.js new file mode 100644 index 0000000..b6489f6 --- /dev/null +++ b/test/fixtures/convert/declare/method-overloading/flow.js @@ -0,0 +1,6 @@ +// @flow +declare class Path extends Node { + // converts Path to a string + toString(): string; + toString(tabWidth: number): string; +} diff --git a/test/fixtures/convert/declare/method-overloading/ts.js b/test/fixtures/convert/declare/method-overloading/ts.js new file mode 100644 index 0000000..eb6958c --- /dev/null +++ b/test/fixtures/convert/declare/method-overloading/ts.js @@ -0,0 +1,6 @@ + +declare class Path extends Node { + // converts Path to a string + toString(): string; + toString(tabWidth: number): string; +} \ No newline at end of file