swc/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts

76 lines
1001 B
TypeScript

class A1 {
public a: number;
}
class B1 {
public a: string;
}
class A2 {
private a: string;
}
class B2 {
private a: string;
}
var a1: A1;
var b1: B1;
var a2: A2;
var b2: B2;
// operator <
var r1a1 = a1 < b1;
var r1a2 = a2 < b2;
var r1b1 = b1 < a1;
var r1b2 = b2 < a2;
// operator >
var r2a1 = a1 > b1;
var r2a2 = a2 > b2;
var r2b1 = b1 > a1;
var r2b2 = b2 > a2;
// operator <=
var r3a1 = a1 <= b1;
var r3a2 = a2 <= b2;
var r3b1 = b1 <= a1;
var r3b2 = b2 <= a2;
// operator >=
var r4a1 = a1 >= b1;
var r4a2 = a2 >= b2;
var r4b1 = b1 >= a1;
var r4b2 = b2 >= a2;
// operator ==
var r5a1 = a1 == b1;
var r5a2 = a2 == b2;
var r5b1 = b1 == a1;
var r5b2 = b2 == a2;
// operator !=
var r6a1 = a1 != b1;
var r6a2 = a2 != b2;
var r6b1 = b1 != a1;
var r6b2 = b2 != a2;
// operator ===
var r7a1 = a1 === b1;
var r7a2 = a2 === b2;
var r7b1 = b1 === a1;
var r7b2 = b2 === a2;
// operator !==
var r8a1 = a1 !== b1;
var r8a2 = a2 !== b2;
var r8b1 = b1 !== a1;
var r8b2 = b2 !== a2;