diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-09-23 11:39:20 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-23 11:39:20 +1000 |
commit | 751bb45a0a4ca4ab3baf5e5037c0b10f0430aeb6 (patch) | |
tree | b02ca1ea7f96b9d844fef5981383fffea788c9c3 /cli | |
parent | 68fd7a927b26c3e72cf73515821450f3aa252014 (diff) |
fix: ignore fileExists in tsc host (#7635)
Fixes #7630
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tests/fix_tsc_file_exists.out | 1 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 5 | ||||
-rw-r--r-- | cli/tests/tsc/a.js | 2 | ||||
-rw-r--r-- | cli/tests/tsc/d.ts | 3 | ||||
-rw-r--r-- | cli/tests/tsc/node_modules/b.js | 2 | ||||
-rw-r--r-- | cli/tests/tsc/node_modules/c.js | 1 | ||||
-rw-r--r-- | cli/tests/tsc/test.js | 4 | ||||
-rw-r--r-- | cli/tsc/99_main_compiler.js | 5 |
8 files changed, 21 insertions, 2 deletions
diff --git a/cli/tests/fix_tsc_file_exists.out b/cli/tests/fix_tsc_file_exists.out new file mode 100644 index 000000000..ce0136250 --- /dev/null +++ b/cli/tests/fix_tsc_file_exists.out @@ -0,0 +1 @@ +hello diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 7e0e020d6..4ec816c4f 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2378,6 +2378,11 @@ itest!(fix_js_imports { output: "fix_js_imports.ts.out", }); +itest!(fix_tsc_file_exists { + args: "run --quiet --reload tsc/test.js", + output: "fix_tsc_file_exists.out", +}); + itest!(es_private_fields { args: "run --quiet --reload es_private_fields.js", output: "es_private_fields.js.out", diff --git a/cli/tests/tsc/a.js b/cli/tests/tsc/a.js new file mode 100644 index 000000000..5a7b3ff93 --- /dev/null +++ b/cli/tests/tsc/a.js @@ -0,0 +1,2 @@ +import { v4 } from "./d.ts"; +export function a() {} diff --git a/cli/tests/tsc/d.ts b/cli/tests/tsc/d.ts new file mode 100644 index 000000000..3c74b8c83 --- /dev/null +++ b/cli/tests/tsc/d.ts @@ -0,0 +1,3 @@ +export function v4() { + return "hello"; +} diff --git a/cli/tests/tsc/node_modules/b.js b/cli/tests/tsc/node_modules/b.js new file mode 100644 index 000000000..191660935 --- /dev/null +++ b/cli/tests/tsc/node_modules/b.js @@ -0,0 +1,2 @@ +import c from "./c.js"; +export { c }; diff --git a/cli/tests/tsc/node_modules/c.js b/cli/tests/tsc/node_modules/c.js new file mode 100644 index 000000000..cff71c44a --- /dev/null +++ b/cli/tests/tsc/node_modules/c.js @@ -0,0 +1 @@ +export default function c() {} diff --git a/cli/tests/tsc/test.js b/cli/tests/tsc/test.js new file mode 100644 index 000000000..b7f46b351 --- /dev/null +++ b/cli/tests/tsc/test.js @@ -0,0 +1,4 @@ +import { a } from "./a.js"; +import { c } from "./node_modules/b.js"; + +console.log("hello"); diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 63a5d1f5b..94a08e6ab 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -278,8 +278,9 @@ delete Object.prototype.__proto__; /* TypeScript CompilerHost APIs */ - fileExists(_fileName) { - return notImplemented(); + fileExists(fileName) { + log(`compiler::host.fileExists("${fileName}")`); + return false; } getCanonicalFileName(fileName) { |