diff --git a/tsc/internal/bundled/libs/lib.dom.d.ts b/tsc/internal/bundled/libs/lib.dom.d.ts index 9e127c3f5a524..ac1c1a2cc6b91 100644 --- a/tsc/internal/bundled/libs/lib.dom.d.ts +++ b/tsc/internal/bundled/libs/lib.dom.d.ts @@ -14439,7 +14439,7 @@ interface File extends Blob { declare var File: { prototype: File; - new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; + new(fileBits: Iterable, fileName: string, options?: FilePropertyBag): File; }; /** diff --git a/tsc/internal/bundled/libs/lib.webworker.d.ts b/tsc/internal/bundled/libs/lib.webworker.d.ts index 45c6a6134821d..21c11b034b93d 100644 --- a/tsc/internal/bundled/libs/lib.webworker.d.ts +++ b/tsc/internal/bundled/libs/lib.webworker.d.ts @@ -4680,7 +4680,7 @@ interface File extends Blob { declare var File: { prototype: File; - new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; + new(fileBits: Iterable, fileName: string, options?: FilePropertyBag): File; }; /** diff --git a/tsc/testdata/baselines/reference/compiler/fileConstructorIterableFileBits.symbols b/tsc/testdata/baselines/reference/compiler/fileConstructorIterableFileBits.symbols new file mode 100644 index 0000000000000..0c68a2aa78245 --- /dev/null +++ b/tsc/testdata/baselines/reference/compiler/fileConstructorIterableFileBits.symbols @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/fileConstructorIterableFileBits.ts] //// + +=== fileConstructorIterableFileBits.ts === +new File((function* () { +>File : Symbol(File, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) + + yield "a"; +})(), "name"); + diff --git a/tsc/testdata/baselines/reference/compiler/fileConstructorIterableFileBits.types b/tsc/testdata/baselines/reference/compiler/fileConstructorIterableFileBits.types new file mode 100644 index 0000000000000..b6d0552b0bb8e --- /dev/null +++ b/tsc/testdata/baselines/reference/compiler/fileConstructorIterableFileBits.types @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/fileConstructorIterableFileBits.ts] //// + +=== fileConstructorIterableFileBits.ts === +new File((function* () { +>new File((function* () { yield "a";})(), "name") : File +>File : { new (fileBits: Iterable, fileName: string, options?: FilePropertyBag): File; prototype: File; } +>(function* () { yield "a";})() : Generator +>(function* () { yield "a";}) : () => Generator +>function* () { yield "a";} : () => Generator + + yield "a"; +>yield "a" : any +>"a" : "a" + +})(), "name"); +>"name" : "name" + diff --git a/tsc/testdata/fixtures/lib/dom.generated.d.ts b/tsc/testdata/fixtures/lib/dom.generated.d.ts index d667879250cf4..514d959aaed42 100644 --- a/tsc/testdata/fixtures/lib/dom.generated.d.ts +++ b/tsc/testdata/fixtures/lib/dom.generated.d.ts @@ -14423,7 +14423,7 @@ interface File extends Blob { declare var File: { prototype: File; - new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; + new(fileBits: Iterable, fileName: string, options?: FilePropertyBag): File; }; /** diff --git a/tsc/testdata/tests/cases/compiler/fileConstructorIterableFileBits.ts b/tsc/testdata/tests/cases/compiler/fileConstructorIterableFileBits.ts new file mode 100644 index 0000000000000..f1d6cef4f47d1 --- /dev/null +++ b/tsc/testdata/tests/cases/compiler/fileConstructorIterableFileBits.ts @@ -0,0 +1,7 @@ +// @target: es2022 +// @lib: es2022,dom +// @noEmit: true + +new File((function* () { + yield "a"; +})(), "name");