fix: Change unknown bun:bundle export from warning to error

- Unknown exports from "bun:bundle" now produce an error instead of a warning
- Remove unnecessary comment in visitStmt.zig

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2025-12-11 03:24:19 +00:00
parent 7cdf07e36e
commit 21d93e97fa
2 changed files with 1 additions and 5 deletions

View File

@@ -2679,8 +2679,7 @@ pub fn NewParser_(
const ref = try p.declareSymbol(.other, item.name.loc, name);
p.bundler_feature_flag_ref = ref;
} else {
// Warn about unknown specifiers
try p.log.addWarningFmt(p.source, item.alias_loc, p.allocator, "\"bun:bundle\" only exports \"feature\"; \"{s}\" will be undefined", .{item.alias});
try p.log.addErrorFmt(p.source, item.alias_loc, p.allocator, "\"bun:bundle\" has no export named \"{s}\"", .{item.alias});
}
}
// Return empty statement - the import is completely removed

View File

@@ -40,9 +40,6 @@ pub fn VisitStmt(
const visitors = struct {
pub fn s_import(noalias p: *P, noalias stmts: *ListManaged(Stmt), noalias stmt: *Stmt, noalias data: *S.Import) !void {
// Note: `import { feature } from "bun:bundle"` is handled at parse time
// in processImportStatement(), not here at visit time.
try p.recordDeclaredSymbol(data.namespace_ref);
if (data.default_name) |default_name| {