* Always generate type & symbol baselines * Accept changed shadowed baselines * Accept brand new type and symbol baselines * Allow `getTypeAtLocation` to return undefined in the type writer * Accept baselines which had missing type information * Bind container for dynamically names enum members so they may be printed * Accept type/symbol baselines for enums with computed members * First pass at reducing typeWriter memory overhead * Use generators to allow for type and symbol baselines with no cache * Accept new baselines for tests whose output was fixed by better newline splitting * Hard cap on number of declarations printed, cache declaration print text * handle differing newlines better still to handle RWC newlines * Lower abridging count, accept abridged baselines * Limit max RWC error output size, limit RWC type and symbol baseline input size * Move skip logic into type and symbol baseliner to streamline error handling * Accept removal of empty baselines * Canonicalize path earlier to handle odd paths in input files * Do canonicalization earlier still, also ensure parallel perf profiles for different targets do not trample one another * No need to pathify again
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
=== tests/cases/compiler/instanceofOperator.ts ===
|
||
// Spec:
|
||
// The instanceof operator requires the left operand to be of type Any or an object type, and the right
|
||
// operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the
|
||
// Boolean primitive type.
|
||
|
||
module test {
|
||
>test : typeof test
|
||
|
||
class Object { }
|
||
>Object : Object
|
||
|
||
var obj: Object;
|
||
>obj : Object
|
||
>Object : Object
|
||
|
||
|
||
|
||
4 instanceof null;
|
||
>4 instanceof null : boolean
|
||
>4 : 4
|
||
>null : null
|
||
|
||
// Error and should be error
|
||
obj instanceof 4;
|
||
>obj instanceof 4 : boolean
|
||
>obj : Object
|
||
>4 : 4
|
||
|
||
Object instanceof obj;
|
||
>Object instanceof obj : boolean
|
||
>Object : typeof Object
|
||
>obj : Object
|
||
|
||
// Error on left hand side
|
||
null instanceof null;
|
||
>null instanceof null : boolean
|
||
>null : null
|
||
>null : null
|
||
|
||
obj instanceof Object;
|
||
>obj instanceof Object : boolean
|
||
>obj : Object
|
||
>Object : typeof Object
|
||
|
||
undefined instanceof undefined;
|
||
>undefined instanceof undefined : boolean
|
||
>undefined : undefined
|
||
>undefined : undefined
|
||
}
|
||
|
||
|