mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 14:22:01 +00:00
fix build issue
This commit is contained in:
@@ -13,9 +13,15 @@ pub fn BabyList(comptime Type: type) type {
|
||||
len: u32 = 0,
|
||||
cap: u32 = 0,
|
||||
|
||||
pub fn ensureUnusedCapacity(this: *@This(), allocator: std.mem.Allocator, count: usize) !void {
|
||||
var list_ = this.listManaged(allocator);
|
||||
try list_.ensureUnusedCapacity(count);
|
||||
this.update(list_);
|
||||
}
|
||||
|
||||
pub fn append(this: *@This(), allocator: std.mem.Allocator, value: Type) !void {
|
||||
if (this.len + 1 < this.cap) {
|
||||
var list_ = listManaged(allocator);
|
||||
var list_ = this.listManaged(allocator);
|
||||
try list_.ensureUnusedCapacity(1);
|
||||
this.update(list_);
|
||||
}
|
||||
|
||||
@@ -4258,7 +4258,7 @@ pub const Ast = struct {
|
||||
symbols: Symbol.List = Symbol.List{},
|
||||
module_scope: ?Scope = null,
|
||||
// char_freq: *CharFreq,
|
||||
exports_ref: ?Ref = null,
|
||||
exports_ref: Ref = Ref.None,
|
||||
module_ref: ?Ref = null,
|
||||
wrapper_ref: ?Ref = null,
|
||||
require_ref: Ref = Ref.None,
|
||||
@@ -4327,7 +4327,7 @@ pub const ExportsKind = enum {
|
||||
// "exports") with getters for the export names. All named imports to this
|
||||
// module are allowed. Direct named imports reference the corresponding export
|
||||
// directly. Other imports go through property accesses on "exports".
|
||||
esm_with_dyn,
|
||||
esm_with_dynamic_fallback,
|
||||
|
||||
pub fn jsonStringify(self: @This(), opts: anytype, o: anytype) !void {
|
||||
return try std.json.stringify(@tagName(self), opts, o);
|
||||
|
||||
@@ -4460,8 +4460,8 @@ fn NewParser_(
|
||||
}
|
||||
}
|
||||
|
||||
for (scope.children.slice) |_, i| {
|
||||
p.hoistSymbols(scope.children.items[i]);
|
||||
for (scope.children.slice()) |_, i| {
|
||||
p.hoistSymbols(scope.children.ptr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7217,9 +7217,9 @@ fn NewParser_(
|
||||
const child = _child orelse continue;
|
||||
|
||||
if (child.scope.parent == p.current_scope) {
|
||||
var i: usize = children.len - 1;
|
||||
var i: usize = children.items.len - 1;
|
||||
while (i >= 0) {
|
||||
if (children.ptr[i] == child.scope) {
|
||||
if (children.items[i] == child.scope) {
|
||||
_ = children.orderedRemove(i);
|
||||
break;
|
||||
}
|
||||
@@ -16293,11 +16293,11 @@ fn NewParser_(
|
||||
// by the time we get here.
|
||||
p.scopes_in_order.items[scope_index] = null;
|
||||
// Remove the last child from the parent scope
|
||||
const last = parent.children.items.len - 1;
|
||||
if (comptime Environment.allow_assert) assert(parent.children.items[last] == to_flatten);
|
||||
_ = parent.children.popOrNull();
|
||||
const last = parent.children.len - 1;
|
||||
if (comptime Environment.allow_assert) assert(parent.children.ptr[last] == to_flatten);
|
||||
parent.children.len -|= 1;
|
||||
|
||||
for (to_flatten.children.items) |item| {
|
||||
for (to_flatten.children.slice()) |item| {
|
||||
item.parent = parent;
|
||||
parent.children.append(p.allocator, item) catch unreachable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user