summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2019-09-10 12:39:42 +0900
committerRyan Dahl <ry@tinyclouds.org>2019-09-09 23:39:42 -0400
commit46cbc6e0e96750cd2e3ba7e0d80bb9c48b66caf2 (patch)
tree89889584009ffd44cf01f2d5ee9e73e2a027c9ca /js
parent35e3c06aed851f65ad0d561d73a447ab5765fc13 (diff)
refactor: remove Deno.platform (#2895)
Diffstat (limited to 'js')
-rw-r--r--js/build.ts3
-rw-r--r--js/deno.ts2
-rw-r--r--js/lib.deno_runtime.d.ts1
-rw-r--r--js/process_test.ts6
-rw-r--r--js/symlink.ts6
-rw-r--r--js/symlink_test.ts4
6 files changed, 9 insertions, 13 deletions
diff --git a/js/build.ts b/js/build.ts
index 16640d793..942f57458 100644
--- a/js/build.ts
+++ b/js/build.ts
@@ -25,6 +25,3 @@ export function setBuildInfo(os: OperatingSystem, arch: Arch): void {
Object.freeze(build);
}
-
-// TODO(kevinkassimo): deprecate Deno.platform
-export const platform = build;
diff --git a/js/deno.ts b/js/deno.ts
index efccb7741..4efa641d3 100644
--- a/js/deno.ts
+++ b/js/deno.ts
@@ -86,7 +86,7 @@ export {
Signal
} from "./process.ts";
export { inspect, customInspect } from "./console.ts";
-export { build, platform, OperatingSystem, Arch } from "./build.ts";
+export { build, OperatingSystem, Arch } from "./build.ts";
export { version } from "./version.ts";
export const args: string[] = [];
diff --git a/js/lib.deno_runtime.d.ts b/js/lib.deno_runtime.d.ts
index dd220d73e..6027f39b8 100644
--- a/js/lib.deno_runtime.d.ts
+++ b/js/lib.deno_runtime.d.ts
@@ -1198,7 +1198,6 @@ declare namespace Deno {
os: OperatingSystem;
}
export const build: BuildInfo;
- export const platform: BuildInfo;
// @url js/version.d.ts
diff --git a/js/process_test.ts b/js/process_test.ts
index 0f9f608e8..42db06dee 100644
--- a/js/process_test.ts
+++ b/js/process_test.ts
@@ -312,15 +312,15 @@ testPerm({ run: true }, async function runClose(): Promise<void> {
});
test(function signalNumbers(): void {
- if (Deno.platform.os === "mac") {
+ if (Deno.build.os === "mac") {
assertEquals(Deno.Signal.SIGSTOP, 17);
- } else if (Deno.platform.os === "linux") {
+ } else if (Deno.build.os === "linux") {
assertEquals(Deno.Signal.SIGSTOP, 19);
}
});
// Ignore signal tests on windows for now...
-if (Deno.platform.os !== "win") {
+if (Deno.build.os !== "win") {
test(function killPermissions(): void {
let caughtError = false;
try {
diff --git a/js/symlink.ts b/js/symlink.ts
index 4418e22ce..21ebb2f59 100644
--- a/js/symlink.ts
+++ b/js/symlink.ts
@@ -2,7 +2,7 @@
import { sendSync, sendAsync } from "./dispatch_json.ts";
import * as dispatch from "./dispatch.ts";
import * as util from "./util.ts";
-import { platform } from "./build.ts";
+import { build } from "./build.ts";
/** Synchronously creates `newname` as a symbolic link to `oldname`. The type
* argument can be set to `dir` or `file` and is only available on Windows
@@ -15,7 +15,7 @@ export function symlinkSync(
newname: string,
type?: string
): void {
- if (platform.os === "win" && type) {
+ if (build.os === "win" && type) {
return util.notImplemented();
}
sendSync(dispatch.OP_SYMLINK, { oldname, newname });
@@ -32,7 +32,7 @@ export async function symlink(
newname: string,
type?: string
): Promise<void> {
- if (platform.os === "win" && type) {
+ if (build.os === "win" && type) {
return util.notImplemented();
}
await sendAsync(dispatch.OP_SYMLINK, { oldname, newname });
diff --git a/js/symlink_test.ts b/js/symlink_test.ts
index 10d4fe738..bce1f6ae5 100644
--- a/js/symlink_test.ts
+++ b/js/symlink_test.ts
@@ -14,7 +14,7 @@ testPerm({ read: true, write: true }, function symlinkSyncSuccess(): void {
errOnWindows = e;
}
if (errOnWindows) {
- assertEquals(Deno.platform.os, "win");
+ assertEquals(Deno.build.os, "win");
assertEquals(errOnWindows.kind, Deno.ErrorKind.Other);
assertEquals(errOnWindows.message, "Not implemented");
} else {
@@ -49,7 +49,7 @@ testPerm({ write: true }, function symlinkSyncNotImplemented(): void {
err = e;
}
if (err) {
- assertEquals(Deno.platform.os, "win");
+ assertEquals(Deno.build.os, "win");
assertEquals(err.message, "Not implemented");
}
});