提交 a906203d 编写于 作者: J Johannes Rieken

debt - remove unused IEqualable

上级 d6a66ba9
......@@ -6,16 +6,6 @@
import * as Types from 'vs/base/common/types';
/**
* Equalable objects can compute a
* hash-code and can also tell if they
* are equal to other objects.
*/
export interface IEqualable {
equals(other: any): boolean;
}
export function clone<T>(obj: T): T {
if (!obj || typeof obj !== 'object') {
return obj;
......
......@@ -4,9 +4,8 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import errors = require('vs/base/common/errors');
import objects = require('vs/base/common/objects');
import instantiation = require('./instantiation');
import {illegalArgument} from 'vs/base/common/errors';
import * as instantiation from './instantiation';
export class AbstractDescriptor<T> {
......@@ -30,12 +29,12 @@ export class AbstractDescriptor<T> {
_validate(type: T): void {
if (!type) {
throw errors.illegalArgument('can not be falsy');
throw illegalArgument('can not be falsy');
}
}
}
export class SyncDescriptor<T> extends AbstractDescriptor<T> implements objects.IEqualable {
export class SyncDescriptor<T> extends AbstractDescriptor<T> {
constructor(private _ctor: any, ...staticArguments: any[]) {
super(staticArguments);
......@@ -45,16 +44,6 @@ export class SyncDescriptor<T> extends AbstractDescriptor<T> implements objects.
return this._ctor;
}
public equals(other: any): boolean {
if (other === this) {
return true;
}
if (!(other instanceof SyncDescriptor)) {
return false;
}
return (<SyncDescriptor<T>>other).ctor === this.ctor;
}
protected bind(...moreStaticArguments): SyncDescriptor<T> {
let allArgs = [];
allArgs = allArgs.concat(this.staticArguments());
......@@ -188,7 +177,7 @@ export interface SyncDescriptor8<A1, A2, A3, A4, A5, A6, A7, A8, T> {
bind(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8): SyncDescriptor0<T>;
}
export class AsyncDescriptor<T> extends AbstractDescriptor<T> implements AsyncDescriptor0<T>, objects.IEqualable {
export class AsyncDescriptor<T> extends AbstractDescriptor<T> implements AsyncDescriptor0<T> {
public static create<T>(moduleName: string, ctorName: string): AsyncDescriptor<T> {
return new AsyncDescriptor<T>(moduleName, ctorName);
......@@ -209,17 +198,6 @@ export class AsyncDescriptor<T> extends AbstractDescriptor<T> implements AsyncDe
return this._ctorName;
}
public equals(other: any): boolean {
if (other === this) {
return true;
}
if (!(other instanceof AsyncDescriptor)) {
return false;
}
return (<AsyncDescriptor<any>>other).moduleName === this.moduleName &&
(<AsyncDescriptor<any>>other).ctorName === this.ctorName;
}
bind(...moreStaticArguments): AsyncDescriptor<T> {
let allArgs = [];
allArgs = allArgs.concat(this.staticArguments());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册