File: exponentiationOperatorWithNullValueAndValidOperands.js

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 (41 lines) | stat: -rw-r--r-- 945 bytes parent folder | download | duplicates (7)
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
//// [exponentiationOperatorWithNullValueAndValidOperands.ts]
// If one operand is the null or undefined value, it is treated as having the type of the
// other operand.

enum E {
    a,
    b
}

var a: any;
var b: number;

// operator **
var r1 = null ** a;
var r2 = null ** b;
var r3 = null ** 1;
var r4 = null ** E.a;
var r5 = a ** null;
var r6 = b ** null;
var r7 = 0 ** null;
var r8 = E.b ** null;

//// [exponentiationOperatorWithNullValueAndValidOperands.js]
// If one operand is the null or undefined value, it is treated as having the type of the
// other operand.
var E;
(function (E) {
    E[E["a"] = 0] = "a";
    E[E["b"] = 1] = "b";
})(E || (E = {}));
var a;
var b;
// operator **
var r1 = Math.pow(null, a);
var r2 = Math.pow(null, b);
var r3 = Math.pow(null, 1);
var r4 = Math.pow(null, E.a);
var r5 = Math.pow(a, null);
var r6 = Math.pow(b, null);
var r7 = Math.pow(0, null);
var r8 = Math.pow(E.b, null);