TS: Fix a crash when allowJs: true was set

This commit is contained in:
Asger F
2019-11-18 13:02:12 +00:00
parent 7d558d165a
commit 01ab8f07eb
7 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
import f = require("./tst");
f("world");

View File

@@ -0,0 +1,5 @@
| main.ts:1:8:1:8 | f | (x: string) => string |
| main.ts:1:20:1:26 | "./tst" | any |
| main.ts:2:1:2:1 | f | (x: string) => string |
| main.ts:2:1:2:10 | f("world") | string |
| main.ts:2:3:2:9 | "world" | "world" |

View File

@@ -0,0 +1,4 @@
import javascript
from Expr e
select e, e.getType()

View File

@@ -0,0 +1,6 @@
{
"compilerOptions": {
"allowJs": true
},
"include": ["."]
}

View File

@@ -0,0 +1,6 @@
/**
* @param {String} x
*/
module.exports = function(x) {
return 'Hello ' + x;
}