Merge pull request #766 from asger-semmle/ts-compiler-3.2

TS: Support TypeScript 3.2
This commit is contained in:
Max Schaefer
2019-01-16 08:49:45 +00:00
committed by GitHub
31 changed files with 5072 additions and 2707 deletions

View File

@@ -0,0 +1,3 @@
| tst.ts:1:25:1:28 | 100n | 100.0 |
| tst.ts:2:25:2:56 | 1000000 ... 000000n | 1.0E30 |
| tst.ts:3:25:3:56 | 1000000 ... 000000n | 1.0E30 |

View File

@@ -0,0 +1,4 @@
import javascript
from BigIntLiteral literal
select literal, literal.getFloatValue()

View File

@@ -0,0 +1 @@
| tst.ts:1:25:1:28 | 100n | 100 |

View File

@@ -0,0 +1,4 @@
import javascript
from BigIntLiteral literal
select literal, literal.getIntValue()

View File

@@ -0,0 +1,4 @@
| tst.ts:1:5:1:11 | hundred |
| tst.ts:2:5:2:12 | bigValue |
| tst.ts:3:5:3:20 | bigNegativeValue |
| tst.ts:5:5:5:14 | bigintType |

View File

@@ -0,0 +1,5 @@
import javascript
from Expr e
where e.getType() instanceof BigIntType
select e

View File

@@ -0,0 +1 @@
| tst.ts:6:24:6:28 | 1000n | 1000 |

View File

@@ -0,0 +1,4 @@
import javascript
from BigIntLiteralTypeExpr type
select type, type.getIntValue()

View File

@@ -0,0 +1 @@
| tst.ts:5:24:5:29 | bigint |

View File

@@ -0,0 +1,5 @@
import javascript
from TypeExpr type
where type.isBigInt()
select type

View File

@@ -0,0 +1 @@
| 1000n | 1000 |

View File

@@ -0,0 +1,4 @@
import javascript
from BigIntLiteralType type
select type, type.getIntValue()

View File

@@ -0,0 +1 @@
{"include": ["."]}

View File

@@ -0,0 +1,6 @@
let hundred = 100n;
let bigValue = 1000000000000000000000000000000n;
let bigNegativeValue = -1000000000000000000000000000000n;
let bigintType: bigint;
let bigintLiteralType: 1000n;

View File

@@ -41,7 +41,7 @@
| tst.ts:29:22:29:26 | never | never |
| tst.ts:30:17:30:22 | symbol | symbol |
| tst.ts:31:25:31:37 | unique symbol | unique symbol |
| tst.ts:32:17:32:22 | object | any |
| tst.ts:32:17:32:22 | object | object |
| tst.ts:33:19:33:24 | string | string |
| tst.ts:33:19:33:38 | string & {x: string} | string & { x: string; } |
| tst.ts:33:28:33:38 | {x: string} | { x: string; } |