-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: if an argument is decorated with
?
and undefined
or null
r…
…emove the option type [converter][web] Fix #114
- Loading branch information
1 parent
e75209f
commit a413d14
Showing
5 changed files
with
69 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
tests/specs/references/class/methodWithOptionParametersDescribedWithOptionalType.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
interface PromiseLike<T> { | ||
a(onfulfilled?: string | undefined | null); | ||
b(onfulfilled?: string | undefined); | ||
c(onfulfilled?: string | null); | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/specs/references/class/methodWithOptionParametersDescribedWithOptionalType.fsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open Fable.Core.JsInterop | ||
open System | ||
|
||
[<AllowNullLiteral>] | ||
[<Interface>] | ||
type PromiseLike<'T> = | ||
abstract member a: ?onfulfilled: string -> unit | ||
abstract member b: ?onfulfilled: string -> unit | ||
abstract member c: ?onfulfilled: string -> unit | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |
3 changes: 3 additions & 0 deletions
3
tests/specs/references/functionDeclaration/optionalArgumentWithOptionalType.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare function a(onfulfilled?: string | undefined | null); | ||
declare function b(onfulfilled?: string | undefined); | ||
declare function c(onfulfilled?: string | null); |
19 changes: 19 additions & 0 deletions
19
tests/specs/references/functionDeclaration/optionalArgumentWithOptionalType.fsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open Fable.Core.JsInterop | ||
open System | ||
|
||
[<AbstractClass>] | ||
[<Erase>] | ||
type Exports = | ||
[<Import("a", "REPLACE_ME_WITH_MODULE_NAME")>] | ||
static member a (?onfulfilled: string) : unit = nativeOnly | ||
[<Import("b", "REPLACE_ME_WITH_MODULE_NAME")>] | ||
static member b (?onfulfilled: string) : unit = nativeOnly | ||
[<Import("c", "REPLACE_ME_WITH_MODULE_NAME")>] | ||
static member c (?onfulfilled: string) : unit = nativeOnly | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |