Skip to content

Commit

Permalink
Revert "feat: add alert, confirm, and prompt (denoland#7507)"
Browse files Browse the repository at this point in the history
This reverts commit 0dcaea7.
  • Loading branch information
bartlomieju committed Oct 13, 2020
1 parent 0dcaea7 commit 7fc296d
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 135 deletions.
29 changes: 0 additions & 29 deletions cli/dts/lib.deno.window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ declare class Window extends EventTarget {
onunload: ((this: Window, ev: Event) => any) | null;
close: () => void;
readonly closed: boolean;
alert: (message?: string) => void;
confirm: (message?: string) => boolean;
prompt: (message?: string, defaultValue?: string) => string | null;
Deno: typeof Deno;
}

Expand All @@ -26,30 +23,4 @@ declare var self: Window & typeof globalThis;
declare var onload: ((this: Window, ev: Event) => any) | null;
declare var onunload: ((this: Window, ev: Event) => any) | null;

/**
* Shows the given message and waits for the enter key pressed.
* If the stdin is not interactive, it does nothing.
* @param message
*/
declare function alert(message?: string): void;

/**
* Shows the given message and waits for the answer. Returns the user's answer as boolean.
* Only `y` and `Y` are considered as true.
* If the stdin is not interactive, it returns false.
* @param message
*/
declare function confirm(message?: string): boolean;

/**
* Shows the given message and waits for the user's input. Returns the user's input as string.
* If the default value is given and the user inputs the empty string, then it returns the given
* default value.
* If the default value is not given and the user inputs the empty string, it returns null.
* If the stdin is not interactive, it returns null.
* @param message
* @param defaultValue
*/
declare function prompt(message?: string, defaultValue?: string): string | null;

/* eslint-enable @typescript-eslint/no-explicit-any */
66 changes: 0 additions & 66 deletions cli/rt/41_prompt.js

This file was deleted.

4 changes: 0 additions & 4 deletions cli/rt/99_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ delete Object.prototype.__proto__;
const fileReader = window.__bootstrap.fileReader;
const webSocket = window.__bootstrap.webSocket;
const fetch = window.__bootstrap.fetch;
const prompt = window.__bootstrap.prompt;
const denoNs = window.__bootstrap.denoNs;
const denoNsUnstable = window.__bootstrap.denoNsUnstable;
const errors = window.__bootstrap.errors.errors;
Expand Down Expand Up @@ -286,9 +285,6 @@ delete Object.prototype.__proto__;
onunload: util.writable(null),
close: util.writable(windowClose),
closed: util.getterOnly(() => windowIsClosing),
alert: util.writable(prompt.alert),
confirm: util.writable(prompt.confirm),
prompt: util.writable(prompt.prompt),
};

const workerRuntimeGlobalProperties = {
Expand Down
17 changes: 0 additions & 17 deletions cli/tests/066_prompt.ts

This file was deleted.

8 changes: 0 additions & 8 deletions cli/tests/066_prompt.ts.out

This file was deleted.

11 changes: 0 additions & 11 deletions cli/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1917,17 +1917,6 @@ itest!(_065_import_map_info {
output: "065_import_map_info.out",
});

#[cfg(unix)]
#[test]
fn _066_prompt() {
let args = "run --unstable 066_prompt.ts";
let output = "066_prompt.ts.out";
// These are answers to prompt, confirm, and alert calls.
let input = b"John Doe\n\nfoo\nY\nN\nyes\n\n\n\n";

util::test_pty(args, output, input);
}

itest!(js_import_detect {
args: "run --quiet --reload js_import_detect.ts",
output: "js_import_detect.ts.out",
Expand Down

0 comments on commit 7fc296d

Please sign in to comment.