Skip to content

Commit e756182

Browse files
committed
PR Feedback
1 parent 131890a commit e756182

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@types/minimatch": "latest",
4646
"@types/minimist": "latest",
4747
"@types/mkdirp": "latest",
48-
"@types/mocha": "^5.2.2",
48+
"@types/mocha": "latest",
4949
"@types/node": "8.5.5",
5050
"@types/q": "latest",
5151
"@types/run-sequence": "latest",

src/harness/vfs.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,20 +1352,12 @@ namespace vfs {
13521352

13531353
/** Removes a directory in a `FileSet` */
13541354
export class Rmdir {
1355-
private _rmdirBrand?: never; // brand necessary for proper type guards
1355+
public _rmdirBrand?: never; // brand necessary for proper type guards
13561356
}
13571357

13581358
/** Unlinks a file in a `FileSet` */
13591359
export class Unlink {
1360-
private _unlinkBrand?: never; // brand necessary for proper type guards
1361-
}
1362-
1363-
// prevents compiler errors due to unused brand properties
1364-
if (!0) {
1365-
// tslint:disable-next-line:no-string-literal
1366-
ignoreUnused(Rmdir.prototype["_rmdirBrand"]);
1367-
// tslint:disable-next-line:no-string-literal
1368-
ignoreUnused(Unlink.prototype["_unlinkBrand"]);
1360+
public _unlinkBrand?: never; // brand necessary for proper type guards
13691361
}
13701362

13711363
/** Extended options for a symbolic link in a `FileSet` */
@@ -1549,7 +1541,5 @@ namespace vfs {
15491541
}
15501542
return text;
15511543
}
1552-
1553-
function ignoreUnused(_: void) { /*empty*/ }
15541544
}
15551545
// tslint:enable:no-null-keyword

src/testRunner/unittests/tsbuild.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ namespace ts {
398398
const resolver = vfs.createResolver(Harness.IO);
399399
const fs = new vfs.FileSystem(/*ignoreCase*/ true, {
400400
files: {
401-
["/lib"]: new vfs.Mount(vpath.resolve(Harness.IO.getWorkspaceRoot(), "built/local"), patchResolver(resolver)),
401+
["/lib"]: new vfs.Mount(vpath.resolve(Harness.IO.getWorkspaceRoot(), "built/local"), resolver),
402402
["/src"]: new vfs.Mount(vpath.resolve(Harness.IO.getWorkspaceRoot(), root), resolver)
403403
},
404404
cwd: "/",
@@ -407,15 +407,5 @@ namespace ts {
407407
});
408408
fs.makeReadonly();
409409
return fs;
410-
function patchResolver(resolver: vfs.FileSystemResolver): vfs.FileSystemResolver {
411-
const allowedFiles = ["lib.d.ts", "lib.dom.d.ts", "lib.es5.d.ts", "lib.scripthost.d.ts", "lib.webworker.importscripts.d.ts"];
412-
return {
413-
...resolver,
414-
readdirSync(path: string) {
415-
const files = resolver.readdirSync(path);
416-
return files.filter(file => allowedFiles.indexOf(file) !== -1);
417-
}
418-
};
419-
}
420410
}
421411
}

0 commit comments

Comments
 (0)