mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user