mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
Fix issue with detecting AMD like imports (#4009)
This commit is contained in:
parent
503d8bfef2
commit
98e585a284
4 changed files with 16 additions and 1 deletions
|
@ -100,7 +100,12 @@ export class SourceFile {
|
|||
log(`Skipping imports for "${this.filename}"`);
|
||||
return [];
|
||||
}
|
||||
const preProcessedFileInfo = ts.preProcessFile(this.sourceCode, true, true);
|
||||
const preProcessedFileInfo = ts.preProcessFile(
|
||||
this.sourceCode,
|
||||
true,
|
||||
this.mediaType === MediaType.JavaScript ||
|
||||
this.mediaType === MediaType.JSX
|
||||
);
|
||||
this.processed = true;
|
||||
const files = (this.importedFiles = [] as Array<[string, string]>);
|
||||
|
||||
|
|
|
@ -588,6 +588,12 @@ itest!(_054_info_local_imports {
|
|||
exit_code: 0,
|
||||
});
|
||||
|
||||
itest!(js_import_detect {
|
||||
args: "run --reload js_import_detect.ts",
|
||||
output: "js_import_detect.ts.out",
|
||||
exit_code: 0,
|
||||
});
|
||||
|
||||
itest!(lock_write_fetch {
|
||||
args:
|
||||
"run --allow-read --allow-write --allow-env --allow-run lock_write_fetch.ts",
|
||||
|
|
3
cli/tests/js_import_detect.ts
Normal file
3
cli/tests/js_import_detect.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
function define(_foo: string[]): void {}
|
||||
define(["long"]);
|
||||
console.log("ok");
|
1
cli/tests/js_import_detect.ts.out
Normal file
1
cli/tests/js_import_detect.ts.out
Normal file
|
@ -0,0 +1 @@
|
|||
ok
|
Loading…
Reference in a new issue