summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/diagnostics.rs41
-rw-r--r--cli/dts/lib.deno.ns.d.ts18
-rw-r--r--cli/dts/lib.deno.unstable.d.ts14
-rw-r--r--cli/tests/integration_tests.rs6
-rw-r--r--cli/tests/unstable_disabled_ts2551.out10
-rw-r--r--cli/tests/unstable_ts2551.ts1
-rw-r--r--runtime/js/90_deno_ns.js4
7 files changed, 20 insertions, 74 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs
index 695330af3..da9a090c8 100644
--- a/cli/diagnostics.rs
+++ b/cli/diagnostics.rs
@@ -628,45 +628,4 @@ mod tests {
let actual = diagnostics.to_string();
assert_eq!(strip_ansi_codes(&actual), "TS2552 [ERROR]: Cannot find name \'foo_Bar\'. Did you mean \'foo_bar\'?\nfoo_Bar();\n~~~~~~~\n at test.ts:8:1\n\n \'foo_bar\' is declared here.\n function foo_bar() {\n ~~~~~~~\n at test.ts:4:10");
}
-
- #[test]
- fn test_unstable_suggestion() {
- let value = json![
- {
- "start": {
- "line": 0,
- "character": 17
- },
- "end": {
- "line": 0,
- "character": 21
- },
- "fileName": "file:///cli/tests/unstable_ts2551.ts",
- "messageText": "Property 'ppid' does not exist on type 'typeof Deno'. Did you mean 'pid'?",
- "sourceLine": "console.log(Deno.ppid);",
- "relatedInformation": [
- {
- "start": {
- "line": 89,
- "character": 15
- },
- "end": {
- "line": 89,
- "character": 18
- },
- "fileName": "asset:///lib.deno.ns.d.ts",
- "messageText": "'pid' is declared here.",
- "sourceLine": " export const pid: number;",
- "category": 3,
- "code": 2728
- }
- ],
- "category": 1,
- "code": 2551
- }
- ];
- let diagnostics: Diagnostic = serde_json::from_value(value).unwrap();
- let actual = diagnostics.to_string();
- assert_eq!(strip_ansi_codes(&actual), "TS2551 [ERROR]: Property \'ppid\' does not exist on type \'typeof Deno\'. \'Deno.ppid\' is an unstable API. Did you forget to run with the \'--unstable\' flag, or did you mean \'pid\'?\nconsole.log(Deno.ppid);\n ~~~~\n at file:///cli/tests/unstable_ts2551.ts:1:18\n\n \'pid\' is declared here.\n export const pid: number;\n ~~~\n at asset:///lib.deno.ns.d.ts:90:16");
- }
}
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index 2032757bb..8ebf16150 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -90,6 +90,24 @@ declare namespace Deno {
/** The current process id of the runtime. */
export const pid: number;
+ /**
+ * The pid of the current process's parent.
+ */
+ export const ppid: number;
+
+ export interface MemoryUsage {
+ rss: number;
+ heapTotal: number;
+ heapUsed: number;
+ external: number;
+ }
+
+ /**
+ * Returns an object describing the memory usage of the Deno process measured
+ * in bytes.
+ */
+ export function memoryUsage(): MemoryUsage;
+
/** Reflects the `NO_COLOR` environment variable at program start.
*
* See: https://no-color.org/ */
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index 92858ba31..828211c5b 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -1070,11 +1070,6 @@ declare namespace Deno {
export function hostname(): string;
/** **UNSTABLE**: New API, yet to be vetted.
- * The pid of the current process's parent.
- */
- export const ppid: number;
-
- /** **UNSTABLE**: New API, yet to be vetted.
* A custom HttpClient for use with `fetch`.
*
* ```ts
@@ -1171,15 +1166,6 @@ declare namespace Deno {
bytesReceived: number;
}
- export interface MemoryUsage {
- rss: number;
- heapTotal: number;
- heapUsed: number;
- external: number;
- }
-
- export function memoryUsage(): MemoryUsage;
-
export interface RequestEvent {
readonly request: Request;
respondWith(r: Response | Promise<Response>): Promise<void>;
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 2cad5a44c..ce4c8d7d8 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -3976,12 +3976,6 @@ console.log("finish");
output: "unstable_enabled_js.out",
});
- itest!(unstable_disabled_ts2551 {
- args: "run --reload unstable_ts2551.ts",
- exit_code: 1,
- output: "unstable_disabled_ts2551.out",
- });
-
itest!(unstable_worker {
args: "run --reload --unstable --quiet --allow-read unstable_worker.ts",
output: "unstable_worker.ts.out",
diff --git a/cli/tests/unstable_disabled_ts2551.out b/cli/tests/unstable_disabled_ts2551.out
deleted file mode 100644
index bf8e6872b..000000000
--- a/cli/tests/unstable_disabled_ts2551.out
+++ /dev/null
@@ -1,10 +0,0 @@
-[WILDCARD]
-error: TS2551 [ERROR]: Property 'ppid' does not exist on type 'typeof Deno'. 'Deno.ppid' is an unstable API. Did you forget to run with the '--unstable' flag, or did you mean 'pid'?
-console.log(Deno.ppid);
- ~~~~
- at [WILDCARD]cli/tests/unstable_ts2551.ts:1:18
-
- 'pid' is declared here.
- export const pid: number;
- ~~~
- at asset:///lib.deno.ns.d.ts:[WILDCARD]
diff --git a/cli/tests/unstable_ts2551.ts b/cli/tests/unstable_ts2551.ts
deleted file mode 100644
index c9016c56c..000000000
--- a/cli/tests/unstable_ts2551.ts
+++ /dev/null
@@ -1 +0,0 @@
-console.log(Deno.ppid);
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index f563a20fe..9d0590878 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -85,7 +85,7 @@
listen: __bootstrap.net.listen,
connectTls: __bootstrap.tls.connectTls,
listenTls: __bootstrap.tls.listenTls,
- sleepSync: __bootstrap.timers.sleepSync,
+ shutdown: __bootstrap.net.shutdown,
fstatSync: __bootstrap.fs.fstatSync,
fstat: __bootstrap.fs.fstat,
fsyncSync: __bootstrap.fs.fsyncSync,
@@ -119,7 +119,7 @@
systemCpuInfo: __bootstrap.os.systemCpuInfo,
applySourceMap: __bootstrap.errorStack.opApplySourceMap,
formatDiagnostics: __bootstrap.errorStack.opFormatDiagnostics,
- shutdown: __bootstrap.net.shutdown,
+ sleepSync: __bootstrap.timers.sleepSync,
resolveDns: __bootstrap.net.resolveDns,
listen: __bootstrap.netUnstable.listen,
connect: __bootstrap.netUnstable.connect,