Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Deno.platform #2895

Merged
merged 1 commit into from Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions js/build.ts
Expand Up @@ -25,6 +25,3 @@ export function setBuildInfo(os: OperatingSystem, arch: Arch): void {

Object.freeze(build);
}

// TODO(kevinkassimo): deprecate Deno.platform
export const platform = build;
2 changes: 1 addition & 1 deletion js/deno.ts
Expand Up @@ -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[] = [];

Expand Down
1 change: 0 additions & 1 deletion js/lib.deno_runtime.d.ts
Expand Up @@ -1198,7 +1198,6 @@ declare namespace Deno {
os: OperatingSystem;
}
export const build: BuildInfo;
export const platform: BuildInfo;

// @url js/version.d.ts

Expand Down
6 changes: 3 additions & 3 deletions js/process_test.ts
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions js/symlink.ts
Expand Up @@ -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
Expand All @@ -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 });
Expand All @@ -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 });
Expand Down
4 changes: 2 additions & 2 deletions js/symlink_test.ts
Expand Up @@ -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 {
Expand Down Expand Up @@ -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");
}
});
Expand Down