File: strictNullLogicalAndOr.symbols

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (43 lines) | stat: -rw-r--r-- 1,810 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
=== tests/cases/compiler/strictNullLogicalAndOr.ts ===
// Repro from #9113

let sinOrCos = Math.random() < .5;
>sinOrCos : Symbol(sinOrCos, Decl(strictNullLogicalAndOr.ts, 2, 3))
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))

let choice = sinOrCos && Math.sin || Math.cos;
>choice : Symbol(choice, Decl(strictNullLogicalAndOr.ts, 3, 3))
>sinOrCos : Symbol(sinOrCos, Decl(strictNullLogicalAndOr.ts, 2, 3))
>Math.sin : Symbol(Math.sin, Decl(lib.es5.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>sin : Symbol(Math.sin, Decl(lib.es5.d.ts, --, --))
>Math.cos : Symbol(Math.cos, Decl(lib.es5.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>cos : Symbol(Math.cos, Decl(lib.es5.d.ts, --, --))

choice(Math.PI);
>choice : Symbol(choice, Decl(strictNullLogicalAndOr.ts, 3, 3))
>Math.PI : Symbol(Math.PI, Decl(lib.es5.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>PI : Symbol(Math.PI, Decl(lib.es5.d.ts, --, --))

function sq(n?: number): number {
>sq : Symbol(sq, Decl(strictNullLogicalAndOr.ts, 5, 16))
>n : Symbol(n, Decl(strictNullLogicalAndOr.ts, 7, 12))

  const r = n !== undefined && n*n || 0;
>r : Symbol(r, Decl(strictNullLogicalAndOr.ts, 8, 7))
>n : Symbol(n, Decl(strictNullLogicalAndOr.ts, 7, 12))
>undefined : Symbol(undefined)
>n : Symbol(n, Decl(strictNullLogicalAndOr.ts, 7, 12))
>n : Symbol(n, Decl(strictNullLogicalAndOr.ts, 7, 12))

  return r;
>r : Symbol(r, Decl(strictNullLogicalAndOr.ts, 8, 7))
}

sq(3);
>sq : Symbol(sq, Decl(strictNullLogicalAndOr.ts, 5, 16))