summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-05-08 16:12:16 -0400
committerRyan Dahl <ry@tinyclouds.org>2019-05-15 21:14:17 -0400
commite02d8bcf18f8170a41439f4ffa416d26c5846b6e (patch)
treeba4783fe2406a744e9c2d84e110802386f348ac0 /js
parent7d25c559fc841816ac68282ba67e8f0c1fc069bd (diff)
Remove FileInfo.path
Diffstat (limited to 'js')
-rw-r--r--js/file_info.ts8
-rw-r--r--js/read_dir_test.ts7
2 files changed, 1 insertions, 14 deletions
diff --git a/js/file_info.ts b/js/file_info.ts
index 0026d22c8..f2e5a88ae 100644
--- a/js/file_info.ts
+++ b/js/file_info.ts
@@ -27,12 +27,9 @@ export interface FileInfo {
*/
mode: number | null;
- /** Returns the file or directory name. */
+ /** The file or directory name. */
name: string | null;
- /** Returns the file or directory path. */
- path: string | null;
-
/** Returns whether this is info for a regular file. This result is mutually
* exclusive to `FileInfo.isDirectory` and `FileInfo.isSymlink`.
*/
@@ -59,7 +56,6 @@ export class FileInfoImpl implements FileInfo {
created: number | null;
mode: number | null;
name: string | null;
- path: string | null;
/* @internal */
constructor(private _inner: msg.StatRes) {
@@ -69,7 +65,6 @@ export class FileInfoImpl implements FileInfo {
const hasMode = this._inner.hasMode();
const mode = this._inner.mode(); // negative for invalid mode (Windows)
const name = this._inner.name();
- const path = this._inner.path();
this._isFile = this._inner.isFile();
this._isSymlink = this._inner.isSymlink();
@@ -80,7 +75,6 @@ export class FileInfoImpl implements FileInfo {
// null on Windows
this.mode = hasMode ? mode : null;
this.name = name ? name : null;
- this.path = path ? path : null;
}
isFile(): boolean {
diff --git a/js/read_dir_test.ts b/js/read_dir_test.ts
index 55badd0db..3e11df9fe 100644
--- a/js/read_dir_test.ts
+++ b/js/read_dir_test.ts
@@ -3,8 +3,6 @@ import { testPerm, assert, assertEquals } from "./test_util.ts";
type FileInfo = Deno.FileInfo;
-const isWin = Deno.build.os === "win";
-
function assertSameContent(files: FileInfo[]): void {
let counter = 0;
@@ -15,11 +13,6 @@ function assertSameContent(files: FileInfo[]): void {
}
if (file.name === "002_hello.ts") {
- if (isWin) {
- assert(file.path.endsWith(`tests\\${file.name}`));
- } else {
- assert(file.path.endsWith(`tests/${file.name}`));
- }
assertEquals(file.mode!, Deno.statSync(`tests/${file.name}`).mode!);
counter++;
}