提交 762cc769 编写于 作者: M Matt Bierner

Enable noImplicitThis compiler option

上级 c3a8519e
......@@ -11,6 +11,7 @@
"declaration": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noImplicitThis": true,
"baseUrl": ".",
"typeRoots": [
"typings"
......
......@@ -62,7 +62,7 @@ export function debounce(delay: number): Function {
return createDecorator((fn, key) => {
const timerKey = `$debounce$${key}`;
return function (...args: any[]) {
return function (this: any, ...args: any[]) {
clearTimeout(this[timerKey]);
this[timerKey] = setTimeout(() => fn.apply(this, args), delay);
};
......
......@@ -10,7 +10,7 @@ export function not(fn: Function): Function {
return (...args) => !fn(...args);
}
export function once<T extends Function>(fn: T): T {
export function once<T extends Function>(this: any, fn: T): T {
const _this = this;
let didCall = false;
let result: any;
......
......@@ -198,7 +198,7 @@ suite('Types', () => {
assert(types.create(zeroConstructor) instanceof zeroConstructor);
assert(types.isObject(types.create(zeroConstructor)));
let manyArgConstructor = function (foo, bar) {
let manyArgConstructor = function (this: any, foo, bar) {
this.foo = foo;
this.bar = bar;
};
......
......@@ -85,6 +85,6 @@ export function onError(error: Error, done: () => void): void {
done();
}
export function toResource(path) {
export function toResource(this: any, path: string) {
return URI.file(paths.join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path));
}
......@@ -27,7 +27,7 @@ suite('Flow', () => {
callback(error, null);
},
function getFirst() {
function getFirst(this: any) {
syncThrowsError(this);
},
......@@ -176,17 +176,17 @@ suite('Flow', () => {
errorCount++;
},
function getFirst() {
function getFirst(this: any) {
syncGet('1', this);
},
function handleFirst(first) {
function handleFirst(this: any, first) {
assert.deepEqual('1', first);
assertionCount++;
syncGet('2', this);
},
function handleSecond(second) {
function handleSecond(this: any, second) {
assert.deepEqual('2', second);
assertionCount++;
syncGet(null, this);
......@@ -212,17 +212,17 @@ suite('Flow', () => {
errorCount++;
},
function getFirst() {
function getFirst(this: any) {
asyncGet('1', this);
},
function handleFirst(first) {
function handleFirst(this: any, first) {
assert.deepEqual('1', first);
assertionCount++;
asyncGet('2', this);
},
function handleSecond(second) {
function handleSecond(this: any, second) {
assert.deepEqual('2', second);
assertionCount++;
asyncGet(null, this);
......@@ -252,11 +252,11 @@ suite('Flow', () => {
done();
},
function getFirst() {
function getFirst(this: any) {
syncGet('1', this);
},
function handleFirst(first) {
function handleFirst(this: any, first) {
assert.deepEqual('1', first);
assertionCount++;
syncGet('2', this);
......@@ -289,11 +289,11 @@ suite('Flow', () => {
done();
},
function getFirst() {
function getFirst(this: any) {
syncGet('1', this);
},
function handleFirst(first) {
function handleFirst(this: any, first) {
assert.deepEqual('1', first);
assertionCount++;
syncGetError('2', this);
......@@ -318,11 +318,11 @@ suite('Flow', () => {
done();
},
function getFirst() {
function getFirst(this: any) {
asyncGet('1', this);
},
function handleFirst(first) {
function handleFirst(this: any, first) {
assert.deepEqual('1', first);
assertionCount++;
asyncGet('2', this);
......@@ -355,11 +355,11 @@ suite('Flow', () => {
done();
},
function getFirst() {
function getFirst(this: any) {
asyncGet('1', this);
},
function handleFirst(first) {
function handleFirst(this: any, first) {
assert.deepEqual('1', first);
assertionCount++;
asyncGetError('2', this);
......@@ -377,7 +377,7 @@ suite('Flow', () => {
done();
},
function getFirst() {
function getFirst(this: any) {
syncSequenceGetThrowsError('1', this);
}
);
......@@ -392,11 +392,11 @@ suite('Flow', () => {
errorCount++;
},
function getFirst() {
function getFirst(this: any) {
this(true);
},
function getSecond(result) {
function getSecond(this: any, result) {
assert.equal(result, true);
this(false);
},
......
......@@ -203,7 +203,7 @@ suite('TelemetryService', () => {
});
}));
test('Error events', sinon.test(function () {
test('Error events', sinon.test(function (this: any) {
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
Errors.setUnexpectedErrorHandler(() => { });
......@@ -262,7 +262,7 @@ suite('TelemetryService', () => {
// }
// }));
test('Handle global errors', sinon.test(function () {
test('Handle global errors', sinon.test(function (this: any) {
let errorStub = sinon.stub();
window.onerror = errorStub;
......@@ -289,7 +289,7 @@ suite('TelemetryService', () => {
service.dispose();
}));
test('Uncaught Error Telemetry removes PII from filename', sinon.test(function () {
test('Uncaught Error Telemetry removes PII from filename', sinon.test(function (this: any) {
let errorStub = sinon.stub();
window.onerror = errorStub;
let settings = new ErrorTestingSettings();
......@@ -318,7 +318,7 @@ suite('TelemetryService', () => {
service.dispose();
}));
test('Unexpected Error Telemetry removes PII', sinon.test(function () {
test('Unexpected Error Telemetry removes PII', sinon.test(function (this: any) {
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
Errors.setUnexpectedErrorHandler(() => { });
try {
......@@ -348,7 +348,7 @@ suite('TelemetryService', () => {
}
}));
test('Uncaught Error Telemetry removes PII', sinon.test(function () {
test('Uncaught Error Telemetry removes PII', sinon.test(function (this: any) {
let errorStub = sinon.stub();
window.onerror = errorStub;
let settings = new ErrorTestingSettings();
......@@ -374,7 +374,7 @@ suite('TelemetryService', () => {
service.dispose();
}));
test('Unexpected Error Telemetry removes PII but preserves Code file path', sinon.test(function () {
test('Unexpected Error Telemetry removes PII but preserves Code file path', sinon.test(function (this: any) {
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
Errors.setUnexpectedErrorHandler(() => { });
......@@ -409,7 +409,7 @@ suite('TelemetryService', () => {
}
}));
test('Uncaught Error Telemetry removes PII but preserves Code file path', sinon.test(function () {
test('Uncaught Error Telemetry removes PII but preserves Code file path', sinon.test(function (this: any) {
let errorStub = sinon.stub();
window.onerror = errorStub;
let settings = new ErrorTestingSettings();
......@@ -437,7 +437,7 @@ suite('TelemetryService', () => {
service.dispose();
}));
test('Unexpected Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function () {
test('Unexpected Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function (this: any) {
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
Errors.setUnexpectedErrorHandler(() => { });
......@@ -472,7 +472,7 @@ suite('TelemetryService', () => {
}
}));
test('Uncaught Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function () {
test('Uncaught Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function (this: any) {
let errorStub = sinon.stub();
window.onerror = errorStub;
let settings = new ErrorTestingSettings();
......@@ -500,7 +500,7 @@ suite('TelemetryService', () => {
service.dispose();
}));
test('Unexpected Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function () {
test('Unexpected Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function (this: any) {
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
Errors.setUnexpectedErrorHandler(() => { });
......@@ -535,7 +535,7 @@ suite('TelemetryService', () => {
}
}));
test('Uncaught Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function () {
test('Uncaught Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function (this: any) {
let errorStub = sinon.stub();
window.onerror = errorStub;
let settings = new ErrorTestingSettings();
......@@ -564,7 +564,7 @@ suite('TelemetryService', () => {
service.dispose();
}));
test('Unexpected Error Telemetry removes PII but preserves No Such File error message', sinon.test(function () {
test('Unexpected Error Telemetry removes PII but preserves No Such File error message', sinon.test(function (this: any) {
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
Errors.setUnexpectedErrorHandler(() => { });
......@@ -599,7 +599,7 @@ suite('TelemetryService', () => {
}
}));
test('Uncaught Error Telemetry removes PII but preserves No Such File error message', sinon.test(function () {
test('Uncaught Error Telemetry removes PII but preserves No Such File error message', sinon.test(function (this: any) {
let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler();
Errors.setUnexpectedErrorHandler(() => { });
......
......@@ -19,8 +19,8 @@ import { Verbosity } from 'vs/platform/editor/common/editor';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IModelService } from 'vs/editor/common/services/modelService';
function toResource(path) {
return URI.file(join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path));
function toResource(self, path) {
return URI.file(join('C:\\', new Buffer(self.test.fullTitle()).toString('base64'), path));
}
class ServiceAccessor {
......@@ -44,9 +44,9 @@ suite('Files - FileEditorInput', () => {
});
test('Basics', function (done) {
let input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/file.js'), void 0);
const otherInput = instantiationService.createInstance(FileEditorInput, toResource.call(this, 'foo/bar/otherfile.js'), void 0);
const otherInputSame = instantiationService.createInstance(FileEditorInput, toResource.call(this, 'foo/bar/file.js'), void 0);
let input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0);
const otherInput = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/otherfile.js'), void 0);
const otherInputSame = instantiationService.createInstance(FileEditorInput, toResource(this, 'foo/bar/file.js'), void 0);
assert(input.matches(input));
assert(input.matches(otherInputSame));
......@@ -58,13 +58,13 @@ suite('Files - FileEditorInput', () => {
assert.strictEqual('file.js', input.getName());
assert.strictEqual(toResource.call(this, '/foo/bar/file.js').fsPath, input.getResource().fsPath);
assert.strictEqual(toResource(this, '/foo/bar/file.js').fsPath, input.getResource().fsPath);
assert(input.getResource() instanceof URI);
input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar.html'), void 0);
input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar.html'), void 0);
const inputToResolve: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/file.js'), void 0);
const sameOtherInput: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/file.js'), void 0);
const inputToResolve: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0);
const sameOtherInput: FileEditorInput = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/file.js'), void 0);
return inputToResolve.resolve(true).then(resolved => {
assert.ok(inputToResolve.isResolved());
......@@ -108,10 +108,10 @@ suite('Files - FileEditorInput', () => {
});
test('matches', function () {
const input1 = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0);
const input2 = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0);
const input3 = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/other.js'), void 0);
const input2Upper = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/UPDATEFILE.js'), void 0);
const input1 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0);
const input2 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0);
const input3 = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/other.js'), void 0);
const input2Upper = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/UPDATEFILE.js'), void 0);
assert.strictEqual(input1.matches(null), false);
assert.strictEqual(input1.matches(input1), true);
......@@ -122,7 +122,7 @@ suite('Files - FileEditorInput', () => {
});
test('getEncoding/setEncoding', function (done) {
const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0);
const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0);
input.setEncoding('utf16', EncodingMode.Encode);
assert.equal(input.getEncoding(), 'utf16');
......@@ -137,7 +137,7 @@ suite('Files - FileEditorInput', () => {
});
test('save', function (done) {
const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0);
const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0);
return input.resolve(true).then((resolved: TextFileEditorModel) => {
resolved.textEditorModel.setValue('changed');
......@@ -154,7 +154,7 @@ suite('Files - FileEditorInput', () => {
});
test('revert', function (done) {
const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0);
const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0);
return input.resolve(true).then((resolved: TextFileEditorModel) => {
resolved.textEditorModel.setValue('changed');
......@@ -171,7 +171,7 @@ suite('Files - FileEditorInput', () => {
});
test('resolve handles binary files', function (done) {
const input = instantiationService.createInstance(FileEditorInput, toResource.call(this, '/foo/bar/updatefile.js'), void 0);
const input = instantiationService.createInstance(FileEditorInput, toResource(this, '/foo/bar/updatefile.js'), void 0);
accessor.textFileService.setResolveTextContentErrorOnce(new FileOperationError('error', FileOperationResult.FILE_IS_BINARY));
......@@ -185,7 +185,7 @@ suite('Files - FileEditorInput', () => {
});
test('disposes model when not open anymore', function (done) {
const resource = toResource.call(this, '/path/index.txt');
const resource = toResource(this, '/path/index.txt');
const input = createFileInput(instantiationService, resource);
......
......@@ -27,8 +27,8 @@ class TestFileEditorTracker extends FileEditorTracker {
}
}
function toResource(path) {
return URI.file(join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path));
function toResource(self: any, path: string) {
return URI.file(join('C:\\', new Buffer(self.test.fullTitle()).toString('base64'), path));
}
class ServiceAccessor {
......@@ -58,8 +58,8 @@ suite('Files - FileEditorTracker', () => {
const tracker = instantiationService.createInstance(FileEditorTracker);
assert.ok(tracker);
const parent = toResource.call(this, '/foo/bar');
const resource = toResource.call(this, '/foo/bar/updatefile.js');
const parent = toResource(this, '/foo/bar');
const resource = toResource(this, '/foo/bar/updatefile.js');
let input = instantiationService.createInstance(FileEditorInput, resource, void 0);
group.openEditor(input);
......@@ -72,7 +72,7 @@ suite('Files - FileEditorTracker', () => {
input = instantiationService.createInstance(FileEditorInput, resource, void 0);
group.openEditor(input);
const other = toResource.call(this, '/foo/barfoo');
const other = toResource(this, '/foo/barfoo');
accessor.fileService.fireAfterOperation(new FileOperationEvent(other, FileOperation.DELETE));
assert.ok(!input.isDisposed());
......@@ -81,7 +81,7 @@ suite('Files - FileEditorTracker', () => {
assert.ok(input.isDisposed());
// Move
const to = toResource.call(this, '/foo/barfoo/change.js');
const to: any = toResource(this, '/foo/barfoo/change.js');
accessor.fileService.fireAfterOperation(new FileOperationEvent(resource, FileOperation.MOVE, to));
assert.ok(input.isDisposed());
......@@ -96,8 +96,8 @@ suite('Files - FileEditorTracker', () => {
tracker.setCloseOnFileDelete(false);
assert.ok(tracker);
const parent = toResource.call(this, '/foo/bar');
const resource = toResource.call(this, '/foo/bar/updatefile.js');
const parent = toResource(this, '/foo/bar');
const resource = toResource(this, '/foo/bar/updatefile.js');
let input = instantiationService.createInstance(FileEditorInput, resource, void 0);
group.openEditor(input);
......@@ -110,7 +110,7 @@ suite('Files - FileEditorTracker', () => {
input = instantiationService.createInstance(FileEditorInput, resource, void 0);
group.openEditor(input);
const other = toResource.call(this, '/foo/barfoo');
const other = toResource(this, '/foo/barfoo');
accessor.fileService.fireAfterOperation(new FileOperationEvent(other, FileOperation.DELETE));
assert.ok(!input.isDisposed());
......@@ -119,7 +119,7 @@ suite('Files - FileEditorTracker', () => {
assert.ok(input.isDisposed());
// Move
const to = toResource.call(this, '/foo/barfoo/change.js');
const to: any = toResource(this, '/foo/barfoo/change.js');
accessor.fileService.fireAfterOperation(new FileOperationEvent(resource, FileOperation.MOVE, to));
assert.ok(input.isDisposed());
......@@ -133,8 +133,8 @@ suite('Files - FileEditorTracker', () => {
const tracker = instantiationService.createInstance(FileEditorTracker);
assert.ok(tracker);
const parent = toResource.call(this, '/foo/bar');
const resource = toResource.call(this, '/foo/bar/updatefile.js');
const parent = toResource(this, '/foo/bar');
const resource = toResource(this, '/foo/bar/updatefile.js');
let input = instantiationService.createInstance(FileEditorInput, resource, void 0);
group.openEditor(input);
......@@ -149,7 +149,7 @@ suite('Files - FileEditorTracker', () => {
input = instantiationService.createInstance(FileEditorInput, resource, void 0);
group.openEditor(input);
const other = toResource.call(this, '/foo/barfoo');
const other = toResource(this, '/foo/barfoo');
accessor.fileService.fireFileChanges(new FileChangesEvent([{ resource: other, type: FileChangeType.DELETED }]));
assert.ok(!input.isDisposed());
......@@ -173,7 +173,7 @@ suite('Files - FileEditorTracker', () => {
tracker.setCloseOnFileDelete(false);
assert.ok(tracker);
const resource = toResource.call(this, '/foo/bar/updatefile.js');
const resource = toResource(this, '/foo/bar/updatefile.js');
let input = instantiationService.createInstance(FileEditorInput, resource, void 0);
group.openEditor(input);
......@@ -187,7 +187,7 @@ suite('Files - FileEditorTracker', () => {
test('file change event updates model', function (done) {
const tracker = instantiationService.createInstance(FileEditorTracker);
const resource = toResource.call(this, '/path/index.txt');
const resource = toResource(this, '/path/index.txt');
accessor.textFileService.models.loadOrCreate(resource).then((model: TextFileEditorModel) => {
model.textEditorModel.setValue('Super Good');
......
......@@ -32,8 +32,8 @@ function toResource(path) {
return URI.from({ scheme: 'custom', path });
}
function toFileResource(path) {
return URI.file(paths.join('C:\\', new Buffer(this.test.fullTitle()).toString('base64'), path));
function toFileResource(self, path) {
return URI.file(paths.join('C:\\', new Buffer(self.test.fullTitle()).toString('base64'), path));
}
class TestEditorPart implements IEditorPart {
......@@ -94,7 +94,7 @@ suite('WorkbenchEditorService', () => {
test('basics', function () {
let instantiationService = workbenchInstantiationService();
let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource.call(this, '/something.js'), void 0);
let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource(this, '/something.js'), void 0);
let testEditorPart = new TestEditorPart();
testEditorPart.setActiveEditorInput(activeInput);
......@@ -121,12 +121,12 @@ suite('WorkbenchEditorService', () => {
});
// Open Untyped Input (file)
service.openEditor({ resource: toFileResource.call(this, '/index.html'), options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => {
service.openEditor({ resource: toFileResource(this, '/index.html'), options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => {
assert.strictEqual(editor, activeEditor);
assert(openedEditorInput instanceof FileEditorInput);
let contentInput = <FileEditorInput>openedEditorInput;
assert.strictEqual(contentInput.getResource().fsPath, toFileResource.call(this, '/index.html').fsPath);
assert.strictEqual(contentInput.getResource().fsPath, toFileResource(this, '/index.html').fsPath);
assert(openedEditorOptions instanceof TextEditorOptions);
let textEditorOptions = <TextEditorOptions>openedEditorOptions;
......@@ -134,7 +134,7 @@ suite('WorkbenchEditorService', () => {
});
// Open Untyped Input (file, encoding)
service.openEditor({ resource: toFileResource.call(this, '/index.html'), encoding: 'utf16le', options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => {
service.openEditor({ resource: toFileResource(this, '/index.html'), encoding: 'utf16le', options: { selection: { startLineNumber: 1, startColumn: 1 } } }).then((editor) => {
assert.strictEqual(editor, activeEditor);
assert(openedEditorInput instanceof FileEditorInput);
......@@ -179,18 +179,18 @@ suite('WorkbenchEditorService', () => {
test('caching', function () {
let instantiationService = workbenchInstantiationService();
let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource.call(this, '/something.js'), void 0);
let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource(this, '/something.js'), void 0);
let testEditorPart = new TestEditorPart();
testEditorPart.setActiveEditorInput(activeInput);
let service: WorkbenchEditorService = <any>instantiationService.createInstance(<any>WorkbenchEditorService, testEditorPart);
// Cached Input (Files)
const fileResource1 = toFileResource.call(this, '/foo/bar/cache1.js');
const fileResource1 = toFileResource(this, '/foo/bar/cache1.js');
const fileInput1 = service.createInput({ resource: fileResource1 });
assert.ok(fileInput1);
const fileResource2 = toFileResource.call(this, '/foo/bar/cache2.js');
const fileResource2 = toFileResource(this, '/foo/bar/cache2.js');
const fileInput2 = service.createInput({ resource: fileResource2 });
assert.ok(fileInput2);
......@@ -232,7 +232,7 @@ suite('WorkbenchEditorService', () => {
test('delegate', function (done) {
let instantiationService = workbenchInstantiationService();
let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource.call(this, '/something.js'), void 0);
let activeInput: EditorInput = instantiationService.createInstance(FileEditorInput, toFileResource(this, '/something.js'), void 0);
let testEditorPart = new TestEditorPart();
testEditorPart.setActiveEditorInput(activeInput);
......
......@@ -919,11 +919,11 @@ export class StatResolver {
clb(null, null); // return - we might not have permissions to read the folder or stat the file
},
function stat(): void {
function stat(this: any): void {
fs.stat(fileResource.fsPath, this);
},
function countChildren(fsstat: fs.Stats): void {
function countChildren(this: any, fsstat: fs.Stats): void {
fileStat = fsstat;
if (fileStat.isDirectory()) {
......
......@@ -371,7 +371,7 @@ suite('Files - TextFileService', () => {
});
});
function hotExitTest(setting: string, shutdownReason: ShutdownReason, multipleWindows: boolean, workspace: true, shouldVeto: boolean, done: () => void): void {
function hotExitTest(this: any, setting: string, shutdownReason: ShutdownReason, multipleWindows: boolean, workspace: true, shouldVeto: boolean, done: () => void): void {
model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/file.txt'), 'utf8');
(<TextFileEditorModelManager>accessor.textFileService.models).add(model.getResource(), model);
......
......@@ -477,7 +477,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
}
}
function _applyIconTheme(data: FileIconThemeData, onApply: (theme: FileIconThemeData) => TPromise<IFileIconTheme>): TPromise<IFileIconTheme> {
function _applyIconTheme(this: any, data: FileIconThemeData, onApply: (theme: FileIconThemeData) => TPromise<IFileIconTheme>): TPromise<IFileIconTheme> {
if (!data) {
_applyRules('', iconThemeRulesClassName);
return TPromise.as(onApply(data));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册