mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
parent
5cf194380b
commit
7bda0f567e
6 changed files with 41 additions and 0 deletions
9
cli/dts/lib.dom.asynciterable.d.ts
vendored
Normal file
9
cli/dts/lib.dom.asynciterable.d.ts
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
interface ReadableStream<R = any> {
|
||||
[Symbol.asyncIterator](options?: {
|
||||
preventCancel?: boolean;
|
||||
}): AsyncIterableIterator<R>;
|
||||
}
|
|
@ -3104,6 +3104,11 @@ itest!(runtime_decorators {
|
|||
output: "runtime_decorators.ts.out",
|
||||
});
|
||||
|
||||
itest!(lib_dom_asynciterable {
|
||||
args: "run --quiet --unstable --reload lib_dom_asynciterable.ts",
|
||||
output: "lib_dom_asynciterable.ts.out",
|
||||
});
|
||||
|
||||
itest!(lib_ref {
|
||||
args: "run --quiet --unstable --reload lib_ref.ts",
|
||||
output: "lib_ref.ts.out",
|
||||
|
|
23
cli/tests/lib_dom_asynciterable.ts
Normal file
23
cli/tests/lib_dom_asynciterable.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
const { diagnostics, files } = await Deno.emit("/main.ts", {
|
||||
compilerOptions: {
|
||||
target: "esnext",
|
||||
lib: ["esnext", "dom", "dom.iterable", "dom.asynciterable"],
|
||||
},
|
||||
sources: {
|
||||
"/main.ts": `const rs = new ReadableStream<string>({
|
||||
start(c) {
|
||||
c.enqueue("hello");
|
||||
c.enqueue("deno");
|
||||
c.close();
|
||||
}
|
||||
});
|
||||
|
||||
for await (const s of rs) {
|
||||
console.log("s");
|
||||
}
|
||||
`,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(diagnostics);
|
||||
console.log(Object.keys(files).sort());
|
2
cli/tests/lib_dom_asynciterable.ts.out
Normal file
2
cli/tests/lib_dom_asynciterable.ts.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
[]
|
||||
[ "[WILDCARD]/main.ts.js", "[WILDCARD]/main.ts.js.map" ]
|
|
@ -52,6 +52,7 @@ pub fn get_asset(asset: &str) -> Option<&'static str> {
|
|||
};
|
||||
}
|
||||
match asset {
|
||||
"lib.dom.asynciterable.d.ts" => inc!("lib.dom.asynciterable.d.ts"),
|
||||
"lib.dom.d.ts" => inc!("lib.dom.d.ts"),
|
||||
"lib.dom.iterable.d.ts" => inc!("lib.dom.iterable.d.ts"),
|
||||
"lib.es6.d.ts" => inc!("lib.es6.d.ts"),
|
||||
|
|
1
cli/tsc/00_typescript.js
vendored
1
cli/tsc/00_typescript.js
vendored
|
@ -35757,6 +35757,7 @@ var ts;
|
|||
["es2020", "lib.es2020.d.ts"],
|
||||
["esnext", "lib.esnext.d.ts"],
|
||||
// Host only
|
||||
["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
|
||||
["dom", "lib.dom.d.ts"],
|
||||
["dom.iterable", "lib.dom.iterable.d.ts"],
|
||||
["webworker", "lib.webworker.d.ts"],
|
||||
|
|
Loading…
Add table
Reference in a new issue