mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
Compare commits
18 commits
22e9d74c53
...
ecf3e59113
Author | SHA1 | Date | |
---|---|---|---|
|
ecf3e59113 | ||
|
8cca53b044 | ||
|
53d98a358b | ||
|
a9b4bba3e4 | ||
|
a4e09ad497 | ||
|
5da2a52ec2 | ||
|
52d0cabd9b | ||
|
09c3cae9bf | ||
|
ca469ae97b | ||
|
4db134d19e | ||
|
0b6c8bdbe6 | ||
|
95d7b43e65 | ||
|
63115d2960 | ||
|
29546d8d99 | ||
|
b43ccaceaa | ||
|
81deb058a0 | ||
|
379b477554 | ||
|
de4a115da7 |
5 changed files with 21 additions and 0 deletions
|
@ -304,6 +304,13 @@ fn format_js_error_inner(
|
|||
}
|
||||
|
||||
fn get_suggestions_for_terminal_errors(e: &JsError) -> Vec<FixSuggestion> {
|
||||
if let Some(frame) = e.frames.first() {
|
||||
if let Some(file_name) = &frame.file_name {
|
||||
if file_name.ends_with(".mjs") || file_name.ends_with(".mts") {
|
||||
return vec![];
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(msg) = &e.message {
|
||||
if msg.contains("module is not defined")
|
||||
|| msg.contains("exports is not defined")
|
||||
|
|
4
tests/specs/fmt_errors/__test__.jsonc
Normal file
4
tests/specs/fmt_errors/__test__.jsonc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "run --unstable --allow-read main.mts",
|
||||
"output": "main.out"
|
||||
}
|
6
tests/specs/fmt_errors/a.cts
Normal file
6
tests/specs/fmt_errors/a.cts
Normal file
|
@ -0,0 +1,6 @@
|
|||
function add(num1, num2) {
|
||||
const result = num1 + num2;
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = { add };
|
3
tests/specs/fmt_errors/main.mts
Normal file
3
tests/specs/fmt_errors/main.mts
Normal file
|
@ -0,0 +1,3 @@
|
|||
import * as a from "./a.cts";
|
||||
|
||||
console.log(a.add(1, 2));
|
1
tests/specs/fmt_errors/main.out
Normal file
1
tests/specs/fmt_errors/main.out
Normal file
|
@ -0,0 +1 @@
|
|||
3
|
Loading…
Add table
Reference in a new issue