| 973 | } |
| 974 | |
| 975 | public cmp(other: ContextKeyExpression): number { |
| 976 | if (other.type !== this.type) { |
| 977 | return this.type - other.type; |
| 978 | } |
| 979 | if (this.expr.length < other.expr.length) { |
| 980 | return -1; |
| 981 | } |
| 982 | if (this.expr.length > other.expr.length) { |
| 983 | return 1; |
| 984 | } |
| 985 | for (let i = 0, len = this.expr.length; i < len; i++) { |
| 986 | const r = cmp(this.expr[i], other.expr[i]); |
| 987 | if (r !== 0) { |
| 988 | return r; |
| 989 | } |
| 990 | } |
| 991 | return 0; |
| 992 | } |
| 993 | |
| 994 | public equals(other: ContextKeyExpression): boolean { |
| 995 | if (other.type === this.type) { |