0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix(cli): add lib dom.asynciterable (#9288)

Fixes #9218
This commit is contained in:
Kitson Kelly 2021-01-29 06:41:30 +11:00 committed by GitHub
parent 5cf194380b
commit 7bda0f567e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 0 deletions

9
cli/dts/lib.dom.asynciterable.d.ts vendored Normal file
View 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>;
}

View file

@ -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",

View 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());

View file

@ -0,0 +1,2 @@
[]
[ "[WILDCARD]/main.ts.js", "[WILDCARD]/main.ts.js.map" ]

View file

@ -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"),

View file

@ -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"],