提交 8c97c1d1 编写于 作者: M Matt Bierner

Use `as any` instead of `<any>` for casting in a few places

上级 8639e21b
...@@ -42,18 +42,18 @@ suite('ExtHostDocumentData', () => { ...@@ -42,18 +42,18 @@ suite('ExtHostDocumentData', () => {
}); });
test('readonly-ness', function () { test('readonly-ness', function () {
assert.throws(() => (<any>data).document.uri = null); assert.throws((): void => (data as any).document.uri = null);
assert.throws(() => (<any>data).document.fileName = 'foofile'); assert.throws(() => (data as any).document.fileName = 'foofile');
assert.throws(() => (<any>data).document.isDirty = false); assert.throws(() => (data as any).document.isDirty = false);
assert.throws(() => (<any>data).document.isUntitled = false); assert.throws(() => (data as any).document.isUntitled = false);
assert.throws(() => (<any>data).document.languageId = 'dddd'); assert.throws(() => (data as any).document.languageId = 'dddd');
assert.throws(() => (<any>data).document.lineCount = 9); assert.throws(() => (data as any).document.lineCount = 9);
}); });
test('save, when disposed', function () { test('save, when disposed', function () {
let saved: URI; let saved: URI;
let data = new ExtHostDocumentData(new class extends mock<MainThreadDocumentsShape>() { let data = new ExtHostDocumentData(new class extends mock<MainThreadDocumentsShape>() {
$trySaveDocument(uri) { $trySaveDocument(uri: URI) {
assert.ok(!saved); assert.ok(!saved);
saved = uri; saved = uri;
return TPromise.as(true); return TPromise.as(true);
......
...@@ -10,5 +10,5 @@ export interface Ctor<T> { ...@@ -10,5 +10,5 @@ export interface Ctor<T> {
} }
export function mock<T>(): Ctor<T> { export function mock<T>(): Ctor<T> {
return <any>function () { }; return function () { } as any;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册