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

Remove __timers namespace (#4662)

This commit is contained in:
Ryan Dahl 2020-04-07 11:12:31 -04:00 committed by GitHub
parent 481fcfc8bd
commit 62726430be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 29 deletions

View file

@ -15,12 +15,7 @@ declare interface WindowOrWorkerGlobalScope {
// methods
atob: typeof __textEncoding.atob;
btoa: typeof __textEncoding.btoa;
clearInterval: typeof __timers.clearInterval;
clearTimeout: typeof __timers.clearTimeout;
fetch: typeof __fetch.fetch;
setInterval: typeof __timers.setInterval;
queueMicrotask: typeof __timers.queueMicrotask;
setTimeout: typeof __timers.setTimeout;
// properties
console: __console.Console;
Blob: typeof __blob.DenoBlob;
@ -228,12 +223,23 @@ declare namespace WebAssembly {
declare const atob: typeof __textEncoding.atob;
declare const btoa: typeof __textEncoding.btoa;
declare const clearInterval: typeof __timers.clearInterval;
declare const clearTimeout: typeof __timers.clearTimeout;
declare const fetch: typeof __fetch.fetch;
declare const setInterval: typeof __timers.setInterval;
declare const setTimeout: typeof __timers.setTimeout;
declare const queueMicrotask: typeof __timers.queueMicrotask;
/** Sets a timer which executes a function once after the timer expires. */
declare function setTimeout(
cb: (...args: unknown[]) => void,
delay?: number,
...args: unknown[]
): number;
/** Repeatedly calls a function , with a fixed time delay between each call. */
declare function setInterval(
cb: (...args: unknown[]) => void,
delay?: number,
...args: unknown[]
): number;
declare function clearTimeout(id?: number): void;
declare function clearInterval(id?: number): void;
declare function queueMicrotask(func: Function): void;
declare const console: __console.Console;
declare const Blob: typeof __blob.DenoBlob;
@ -1400,25 +1406,6 @@ declare namespace __textEncoding {
}
}
declare namespace __timers {
export type Args = unknown[];
/** Sets a timer which executes a function once after the timer expires. */
export function setTimeout(
cb: (...args: Args) => void,
delay?: number,
...args: Args
): number;
/** Repeatedly calls a function , with a fixed time delay between each call. */
export function setInterval(
cb: (...args: Args) => void,
delay?: number,
...args: Args
): number;
export function clearTimeout(id?: number): void;
export function clearInterval(id?: number): void;
export function queueMicrotask(func: Function): void;
}
declare namespace __urlSearchParams {
export class URLSearchParams {
constructor(init?: string | string[][] | Record<string, string>);

View file

@ -327,6 +327,9 @@ pub fn trace_serializer() {
pub fn op_fetch_asset<S: ::std::hash::BuildHasher>(
custom_assets: HashMap<String, PathBuf, S>,
) -> impl Fn(&[u8], Option<ZeroCopyBuf>) -> CoreOp {
for (_, path) in custom_assets.iter() {
println!("cargo:rerun-if-changed={}", path.display());
}
move |control: &[u8], zero_copy_buf: Option<ZeroCopyBuf>| -> CoreOp {
assert!(zero_copy_buf.is_none()); // zero_copy_buf unused in this op.
let name = std::str::from_utf8(control).unwrap();