aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-08-24 17:03:05 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-24 17:03:05 -0700
commitd2bef4fbeae798cde08745b211d150417428b270 (patch)
treeb45f9eb48b72d48ee75e9c7ac6004fac65c5cf6a
parent19aa9d93de0971513b1ff94ab72b54c7c2031dda (diff)
downloadbun-d2bef4fbeae798cde08745b211d150417428b270.tar.gz
bun-d2bef4fbeae798cde08745b211d150417428b270.tar.zst
bun-d2bef4fbeae798cde08745b211d150417428b270.zip
Don't inline require/import errors at runtime (#4306)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
-rw-r--r--src/js_printer.zig16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/js_printer.zig b/src/js_printer.zig
index ca8b18ad0..57ef580b6 100644
--- a/src/js_printer.zig
+++ b/src/js_printer.zig
@@ -1828,14 +1828,16 @@ fn NewPrinter(
if (record.kind != .dynamic) {
p.printSpaceBeforeIdentifier();
- if (record.path.is_disabled and record.handles_import_errors and !is_external and p.options.inline_require_and_import_errors) {
- p.printRequireError(record.path.text);
- return;
- }
+ if (p.options.inline_require_and_import_errors) {
+ if (record.path.is_disabled and record.handles_import_errors and !is_external) {
+ p.printRequireError(record.path.text);
+ return;
+ }
- if (record.path.is_disabled) {
- p.printDisabledImport();
- return;
+ if (record.path.is_disabled) {
+ p.printDisabledImport();
+ return;
+ }
}
if (comptime is_bun_platform) {