mirror of
https://github.com/oven-sh/bun
synced 2026-02-24 10:37:20 +01:00
Compare commits
2 Commits
claude/fix
...
claude/rem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b3bb8da22 | ||
|
|
0c24ac85dd |
@@ -2558,10 +2558,10 @@ pub const Data = union(Tag) {
|
||||
},
|
||||
.e_arrow => {},
|
||||
.e_jsx_element => |e| {
|
||||
_ = e; // autofix
|
||||
_ = e;
|
||||
},
|
||||
.e_object => |e| {
|
||||
_ = e; // autofix
|
||||
_ = e;
|
||||
},
|
||||
inline .e_spread, .e_await => |e| {
|
||||
e.value.data.writeToHasher(hasher, symbol_table);
|
||||
@@ -2572,14 +2572,13 @@ pub const Data = union(Tag) {
|
||||
value.data.writeToHasher(hasher, symbol_table);
|
||||
},
|
||||
.e_template => |e| {
|
||||
_ = e; // autofix
|
||||
_ = e;
|
||||
},
|
||||
.e_if => |e| {
|
||||
_ = e; // autofix
|
||||
_ = e;
|
||||
},
|
||||
.e_import => |e| {
|
||||
_ = e; // autofix
|
||||
|
||||
_ = e;
|
||||
},
|
||||
inline .e_identifier,
|
||||
.e_import_identifier,
|
||||
|
||||
@@ -212,14 +212,14 @@ fn writeString32(data: []const u8, w: Writer) !void {
|
||||
// }
|
||||
// if (value.jsType() == .DOMWrapper) {
|
||||
// if (value.as(bun.api.BuildMessage)) |build_error| {
|
||||
// _ = build_error; // autofix
|
||||
// _ = build_error;
|
||||
// //
|
||||
// } else if (value.as(bun.api.ResolveMessage)) |resolve_error| {
|
||||
// _ = resolve_error; // autofix
|
||||
// _ = resolve_error;
|
||||
// @panic("TODO");
|
||||
// }
|
||||
// }
|
||||
// _ = w; // autofix
|
||||
// _ = w;
|
||||
|
||||
// @panic("TODO");
|
||||
// }
|
||||
|
||||
@@ -406,7 +406,7 @@ pub const LifecycleAgent = struct {
|
||||
}
|
||||
|
||||
pub export fn Bun__LifecycleAgentDisable(agent: *Handle) void {
|
||||
_ = agent; // autofix
|
||||
_ = agent;
|
||||
if (VirtualMachine.get().debugger) |*debugger| {
|
||||
debug("disable", .{});
|
||||
debugger.lifecycle_reporter_agent.handle = null;
|
||||
|
||||
@@ -1844,7 +1844,7 @@ pub fn resolveMaybeNeedsTrailingSlash(
|
||||
pub const main_file_name: string = "bun:main";
|
||||
|
||||
pub export fn Bun__drainMicrotasksFromJS(globalObject: *JSGlobalObject, callframe: *jsc.CallFrame) callconv(jsc.conv) JSValue {
|
||||
_ = callframe; // autofix
|
||||
_ = callframe;
|
||||
globalObject.bunVM().drainMicrotasks();
|
||||
return .js_undefined;
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ pub const PollerWindows = union(enum) {
|
||||
}
|
||||
|
||||
pub fn enableKeepingEventLoopAlive(this: *PollerWindows, event_loop: jsc.EventLoopHandle) void {
|
||||
_ = event_loop; // autofix
|
||||
_ = event_loop;
|
||||
switch (this.*) {
|
||||
.uv => |*process| {
|
||||
process.ref();
|
||||
@@ -695,7 +695,7 @@ pub const PollerWindows = union(enum) {
|
||||
}
|
||||
|
||||
pub fn disableKeepingEventLoopAlive(this: *PollerWindows, event_loop: jsc.EventLoopHandle) void {
|
||||
_ = event_loop; // autofix
|
||||
_ = event_loop;
|
||||
|
||||
// This is disabled on Windows
|
||||
// uv_unref() causes the onExitUV callback to *never* be called
|
||||
|
||||
@@ -47,8 +47,8 @@ pub const Readable = union(enum) {
|
||||
}
|
||||
|
||||
pub fn init(stdio: Stdio, event_loop: *jsc.EventLoop, process: *Subprocess, result: StdioResult, allocator: std.mem.Allocator, max_size: ?*MaxBuf, is_sync: bool) Readable {
|
||||
_ = allocator; // autofix
|
||||
_ = is_sync; // autofix
|
||||
_ = allocator;
|
||||
_ = is_sync;
|
||||
Subprocess.assertStdioResult(result);
|
||||
|
||||
if (comptime Environment.isPosix) {
|
||||
@@ -115,7 +115,7 @@ pub const Readable = union(enum) {
|
||||
}
|
||||
|
||||
pub fn toJS(this: *Readable, globalThis: *jsc.JSGlobalObject, exited: bool) bun.JSError!JSValue {
|
||||
_ = exited; // autofix
|
||||
_ = exited;
|
||||
switch (this.*) {
|
||||
// should only be reachable when the entire output is buffered.
|
||||
.memfd => return this.toBufferedValue(globalThis),
|
||||
|
||||
@@ -97,7 +97,7 @@ pub const Writable = union(enum) {
|
||||
switch (pipe.writer.startWithCurrentPipe()) {
|
||||
.result => {},
|
||||
.err => |err| {
|
||||
_ = err; // autofix
|
||||
_ = err;
|
||||
pipe.deref();
|
||||
if (stdio.* == .readable_stream) {
|
||||
stdio.readable_stream.cancel(event_loop.global);
|
||||
@@ -170,7 +170,7 @@ pub const Writable = union(enum) {
|
||||
switch (pipe.writer.start(pipe.fd, true)) {
|
||||
.result => {},
|
||||
.err => |err| {
|
||||
_ = err; // autofix
|
||||
_ = err;
|
||||
pipe.deref();
|
||||
if (stdio.* == .readable_stream) {
|
||||
stdio.readable_stream.cancel(event_loop.global);
|
||||
|
||||
@@ -21,8 +21,8 @@ pub fn getBunServerAllClosedPromise(globalThis: *jsc.JSGlobalObject, callframe:
|
||||
}
|
||||
|
||||
pub fn getMaxHTTPHeaderSize(globalThis: *jsc.JSGlobalObject, callframe: *jsc.CallFrame) bun.JSError!jsc.JSValue {
|
||||
_ = globalThis; // autofix
|
||||
_ = callframe; // autofix
|
||||
_ = globalThis;
|
||||
_ = callframe;
|
||||
return jsc.JSValue.jsNumber(bun.http.max_http_header_size);
|
||||
}
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ pub fn fromPipe(
|
||||
parent: anytype,
|
||||
buffered_reader: anytype,
|
||||
) bun.JSError!jsc.JSValue {
|
||||
_ = parent; // autofix
|
||||
_ = parent;
|
||||
jsc.markBinding(@src());
|
||||
var source = webcore.FileReader.Source.new(.{
|
||||
.globalThis = globalThis,
|
||||
@@ -644,7 +644,7 @@ pub fn NewSource(
|
||||
}
|
||||
|
||||
pub fn isClosed(this: *ReadableStreamSourceType, globalObject: *jsc.JSGlobalObject) jsc.JSValue {
|
||||
_ = globalObject; // autofix
|
||||
_ = globalObject;
|
||||
return jsc.JSValue.jsBoolean(this.is_closed);
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ pub fn NewSource(
|
||||
}
|
||||
|
||||
pub fn cancel(this: *ReadableStreamSourceType, globalObject: *jsc.JSGlobalObject, callFrame: *jsc.CallFrame) bun.JSError!jsc.JSValue {
|
||||
_ = globalObject; // autofix
|
||||
_ = globalObject;
|
||||
jsc.markBinding(@src());
|
||||
this.this_jsvalue = callFrame.this();
|
||||
this.cancel();
|
||||
@@ -716,7 +716,7 @@ pub fn NewSource(
|
||||
}
|
||||
|
||||
pub fn getOnCloseFromJS(this: *ReadableStreamSourceType, globalObject: *jsc.JSGlobalObject) jsc.JSValue {
|
||||
_ = globalObject; // autofix
|
||||
_ = globalObject;
|
||||
|
||||
jsc.markBinding(@src());
|
||||
|
||||
@@ -724,7 +724,7 @@ pub fn NewSource(
|
||||
}
|
||||
|
||||
pub fn getOnDrainFromJS(this: *ReadableStreamSourceType, globalObject: *jsc.JSGlobalObject) jsc.JSValue {
|
||||
_ = globalObject; // autofix
|
||||
_ = globalObject;
|
||||
|
||||
jsc.markBinding(@src());
|
||||
|
||||
@@ -736,7 +736,7 @@ pub fn NewSource(
|
||||
}
|
||||
|
||||
pub fn updateRef(this: *ReadableStreamSourceType, globalObject: *JSGlobalObject, callFrame: *jsc.CallFrame) bun.JSError!jsc.JSValue {
|
||||
_ = globalObject; // autofix
|
||||
_ = globalObject;
|
||||
jsc.markBinding(@src());
|
||||
this.this_jsvalue = callFrame.this();
|
||||
const ref_or_unref = callFrame.argument(0).toBoolean();
|
||||
|
||||
@@ -624,7 +624,7 @@ pub export fn Bun__onSinkDestroyed(
|
||||
ptr_value: ?*anyopaque,
|
||||
sink_ptr: ?*anyopaque,
|
||||
) callconv(.C) void {
|
||||
_ = sink_ptr; // autofix
|
||||
_ = sink_ptr;
|
||||
const ptr = DestructorPtr.from(ptr_value);
|
||||
|
||||
if (ptr.isNull()) {
|
||||
|
||||
@@ -763,7 +763,7 @@ pub const BunxCommand = struct {
|
||||
Global.exit(1);
|
||||
})) {
|
||||
.err => |err| {
|
||||
_ = err; // autofix
|
||||
_ = err;
|
||||
Global.exit(1);
|
||||
},
|
||||
.result => |result| result,
|
||||
|
||||
@@ -148,7 +148,7 @@ pub fn testingImpl(globalThis: *jsc.JSGlobalObject, callframe: *jsc.CallFrame, c
|
||||
}
|
||||
|
||||
fn parserOptionsFromJS(globalThis: *jsc.JSGlobalObject, allocator: Allocator, opts: *bun.css.ParserOptions, jsobj: JSValue) bun.JSError!void {
|
||||
_ = allocator; // autofix
|
||||
_ = allocator;
|
||||
if (try jsobj.getTruthy(globalThis, "flags")) |val| {
|
||||
if (val.isArray()) {
|
||||
var iter = try val.arrayIterator(globalThis);
|
||||
|
||||
@@ -57,7 +57,7 @@ pub const CssModule = struct {
|
||||
}
|
||||
|
||||
pub fn deinit(this: *CssModule) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
// TODO: deinit
|
||||
}
|
||||
|
||||
|
||||
@@ -299,14 +299,14 @@ pub fn voidWrap(comptime T: type, comptime parsefn: *const fn (*Parser) Result(T
|
||||
}
|
||||
|
||||
pub fn DefineListShorthand(comptime T: type) type {
|
||||
_ = T; // autofix
|
||||
_ = T;
|
||||
// TODO: implement this when we implement visit?
|
||||
// does nothing now
|
||||
return struct {};
|
||||
}
|
||||
|
||||
pub fn DefineShorthand(comptime T: type, comptime property_name: PropertyIdTag, comptime PropertyFieldMap: anytype) type {
|
||||
_ = property_name; // autofix
|
||||
_ = property_name;
|
||||
// TODO: validate map, make sure each field is set
|
||||
// make sure each field is same index as in T
|
||||
_ = PropertyFieldMap;
|
||||
@@ -314,9 +314,9 @@ pub fn DefineShorthand(comptime T: type, comptime property_name: PropertyIdTag,
|
||||
return struct {
|
||||
/// Returns a shorthand from the longhand properties defined in the given declaration block.
|
||||
pub fn fromLonghands(allocator: Allocator, decls: *const DeclarationBlock, vendor_prefix: VendorPrefix) ?struct { T, bool } {
|
||||
_ = allocator; // autofix
|
||||
_ = decls; // autofix
|
||||
_ = vendor_prefix; // autofix
|
||||
_ = allocator;
|
||||
_ = decls;
|
||||
_ = vendor_prefix;
|
||||
// var count: usize = 0;
|
||||
// var important_count: usize = 0;
|
||||
// var this: T = undefined;
|
||||
@@ -432,7 +432,7 @@ pub fn DefineShorthand(comptime T: type, comptime property_name: PropertyIdTag,
|
||||
|
||||
/// Returns a shorthand from the longhand properties defined in the given declaration block.
|
||||
pub fn longhands(vendor_prefix: VendorPrefix) []const PropertyId {
|
||||
_ = vendor_prefix; // autofix
|
||||
_ = vendor_prefix;
|
||||
// const out: []const PropertyId = comptime out: {
|
||||
// var out: [std.meta.fields(@TypeOf(T.PropertyFieldMap)).len]PropertyId = undefined;
|
||||
|
||||
@@ -453,9 +453,9 @@ pub fn DefineShorthand(comptime T: type, comptime property_name: PropertyIdTag,
|
||||
|
||||
/// Returns a longhand property for this shorthand.
|
||||
pub fn longhand(this: *const T, allocator: Allocator, property_id: *const PropertyId) ?Property {
|
||||
_ = this; // autofix
|
||||
_ = allocator; // autofix
|
||||
_ = property_id; // autofix
|
||||
_ = this;
|
||||
_ = allocator;
|
||||
_ = property_id;
|
||||
// inline for (std.meta.fields(@TypeOf(T.PropertyFieldMap))) |field| {
|
||||
// if (@as(PropertyIdTag, property_id.*) == @field(T.PropertyFieldMap, field.name)) {
|
||||
// const val = if (@hasDecl(@TypeOf(@field(T, field.namee)), "clone"))
|
||||
@@ -478,9 +478,9 @@ pub fn DefineShorthand(comptime T: type, comptime property_name: PropertyIdTag,
|
||||
|
||||
/// Updates this shorthand from a longhand property.
|
||||
pub fn setLonghand(this: *T, allocator: Allocator, property: *const Property) bool {
|
||||
_ = this; // autofix
|
||||
_ = allocator; // autofix
|
||||
_ = property; // autofix
|
||||
_ = this;
|
||||
_ = allocator;
|
||||
_ = property;
|
||||
// inline for (std.meta.fields(T.PropertyFieldMap)) |field| {
|
||||
// if (@as(PropertyIdTag, property.*) == @field(T.PropertyFieldMap, field.name)) {
|
||||
// const val = if (@hasDecl(@TypeOf(@field(T, field.name)), "clone"))
|
||||
@@ -790,8 +790,8 @@ pub fn DeriveParse(comptime T: type) type {
|
||||
|
||||
// pub fn parse(this: *const T, comptime W: type, dest: *Printer(W)) PrintErr!void {
|
||||
// // to implement this, we need to cargo expand the derive macro
|
||||
// _ = this; // autofix
|
||||
// _ = dest; // autofix
|
||||
// _ = this;
|
||||
// _ = dest;
|
||||
// @compileError(todo_stuff.depth);
|
||||
// }
|
||||
};
|
||||
@@ -974,7 +974,7 @@ fn parse_at_rule(
|
||||
comptime P: type,
|
||||
parser: *P,
|
||||
) Result(P.AtRuleParser.AtRule) {
|
||||
_ = allocator; // autofix
|
||||
_ = allocator;
|
||||
ValidAtRuleParser(P);
|
||||
const delimiters = Delimiters{ .semicolon = true, .curly_bracket = true };
|
||||
const Closure = struct {
|
||||
@@ -1103,7 +1103,7 @@ fn parse_custom_at_rule_body(
|
||||
const result = switch (T.CustomAtRuleParser.parseBlock(at_rule_parser, prelude, start, input, options, is_nested)) {
|
||||
.result => |vv| vv,
|
||||
.err => |e| {
|
||||
_ = e; // autofix
|
||||
_ = e;
|
||||
// match &err.kind {
|
||||
// ParseErrorKind::Basic(kind) => ParseError {
|
||||
// kind: ParseErrorKind::Basic(kind.clone()),
|
||||
@@ -2656,7 +2656,7 @@ pub fn NestedRuleParser(comptime T: type) type {
|
||||
|
||||
pub const RuleBodyItemParser = struct {
|
||||
pub fn parseQualified(this: *This) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3339,7 +3339,7 @@ pub fn StyleSheet(comptime AtRule: type) type {
|
||||
if (comptime !bun.Environment.isDebug) return;
|
||||
|
||||
const layer_names_field_len = this.layer_names.len;
|
||||
_ = layer_names_field_len; // autofix
|
||||
_ = layer_names_field_len;
|
||||
var actual_layer_rules_len: usize = 0;
|
||||
|
||||
for (this.rules.v.items) |*rule| {
|
||||
@@ -3380,7 +3380,7 @@ pub fn StyleSheet(comptime AtRule: type) type {
|
||||
options: ParserOptions,
|
||||
imports_from_tailwind: CssRuleList(AtRule),
|
||||
) @This() {
|
||||
_ = allocator; // autofix
|
||||
_ = allocator;
|
||||
if (comptime AtRule != BundlerAtRule) @compileError("Expected BundlerAtRule for this function.");
|
||||
|
||||
const stylesheet = This{
|
||||
@@ -3514,9 +3514,9 @@ pub const StyleAttribute = struct {
|
||||
}
|
||||
|
||||
pub fn minify(this: *@This(), allocator: Allocator, options: MinifyOptions) void {
|
||||
_ = allocator; // autofix
|
||||
_ = this; // autofix
|
||||
_ = options; // autofix
|
||||
_ = allocator;
|
||||
_ = this;
|
||||
_ = options;
|
||||
// TODO: IMPLEMENT THIS!
|
||||
}
|
||||
};
|
||||
@@ -3670,7 +3670,7 @@ pub fn RuleBodyParser(comptime P: type) type {
|
||||
const Closure = struct { token: Token, start: ParserState };
|
||||
break :result this.input.parseUntilAfter(Delimiters{ .semicolon = true }, I, &Closure{ .token = token, .start = start }, struct {
|
||||
pub fn parseFn(closure: *const Closure, i: *Parser) Result(I) {
|
||||
_ = i; // autofix
|
||||
_ = i;
|
||||
return .{ .err = closure.start.sourceLocation().newUnexpectedTokenError(closure.token) };
|
||||
}
|
||||
}.parseFn);
|
||||
|
||||
@@ -43,8 +43,8 @@ pub const DeclarationBlock = struct {
|
||||
self: *const DeclarationBlock,
|
||||
|
||||
pub fn format(this: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
_ = fmt; // autofix
|
||||
_ = options; // autofix
|
||||
_ = fmt;
|
||||
_ = options;
|
||||
var arraylist = ArrayList(u8){};
|
||||
const w = arraylist.writer(bun.default_allocator);
|
||||
defer arraylist.deinit(bun.default_allocator);
|
||||
@@ -246,14 +246,14 @@ pub const PropertyDeclarationParser = struct {
|
||||
pub const QualifiedRule = void;
|
||||
|
||||
pub fn parsePrelude(this: *This, input: *css.Parser) Result(Prelude) {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return .{ .err = input.newError(css.BasicParseErrorKind.qualified_rule_invalid) };
|
||||
}
|
||||
|
||||
pub fn parseBlock(this: *This, prelude: Prelude, start: *const css.ParserState, input: *css.Parser) Result(QualifiedRule) {
|
||||
_ = this; // autofix
|
||||
_ = prelude; // autofix
|
||||
_ = start; // autofix
|
||||
_ = this;
|
||||
_ = prelude;
|
||||
_ = start;
|
||||
return .{ .err = input.newError(css.BasicParseErrorKind.qualified_rule_invalid) };
|
||||
}
|
||||
};
|
||||
@@ -274,12 +274,12 @@ pub const PropertyDeclarationParser = struct {
|
||||
|
||||
pub const RuleBodyItemParser = struct {
|
||||
pub fn parseQualified(this: *This) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return false;
|
||||
}
|
||||
|
||||
pub fn parseDeclarations(this: *This) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -399,7 +399,7 @@ pub const DeclarationHandler = struct {
|
||||
|
||||
pub fn finalize(this: *DeclarationHandler, context: *css.PropertyHandlerContext) void {
|
||||
const allocator = context.allocator;
|
||||
_ = allocator; // autofix
|
||||
_ = allocator;
|
||||
if (this.direction) |direction| {
|
||||
this.direction = null;
|
||||
bun.handleOom(this.decls.append(context.allocator, css.Property{ .direction = direction }));
|
||||
|
||||
@@ -130,8 +130,8 @@ pub const BasicParseErrorKind = union(enum) {
|
||||
qualified_rule_invalid,
|
||||
|
||||
pub fn format(this: BasicParseErrorKind, comptime fmt: []const u8, opts: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
_ = fmt; // autofix
|
||||
_ = opts; // autofix
|
||||
_ = fmt;
|
||||
_ = opts;
|
||||
return switch (this) {
|
||||
.unexpected_token => |token| {
|
||||
try writer.print("unexpected token: {}", .{token});
|
||||
|
||||
@@ -1334,7 +1334,7 @@ pub const AlignHandler = struct {
|
||||
comptime prop_2009: ?struct { type, []const u8 },
|
||||
comptime prop_2012: ?struct { type, []const u8 },
|
||||
) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
if (key.*) |v| {
|
||||
const val = v[0];
|
||||
var prefix = v[1];
|
||||
@@ -1393,7 +1393,7 @@ pub const AlignHandler = struct {
|
||||
}
|
||||
|
||||
fn flushPrefixedProperty(this: *AlignHandler, dest: *css.DeclarationList, context: *css.PropertyHandlerContext, comptime prop: []const u8, key: anytype) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
if (key) |v| {
|
||||
const val = v[0];
|
||||
const prefix = v[1];
|
||||
@@ -1402,7 +1402,7 @@ pub const AlignHandler = struct {
|
||||
}
|
||||
|
||||
fn flushUnprefixProperty(this: *AlignHandler, dest: *css.DeclarationList, context: *css.PropertyHandlerContext, comptime prop: []const u8, key: anytype) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
if (key) |v| {
|
||||
const val = v;
|
||||
bun.handleOom(dest.append(context.allocator, @unionInit(Property, prop, val)));
|
||||
|
||||
@@ -35,7 +35,7 @@ pub const Border = GenericBorder(LineStyle, 10);
|
||||
|
||||
/// A generic type that represents the `border` and `outline` shorthand properties.
|
||||
pub fn GenericBorder(comptime S: type, comptime P: u8) type {
|
||||
_ = P; // autofix
|
||||
_ = P;
|
||||
return struct {
|
||||
/// The width of the border.
|
||||
width: BorderSideWidth,
|
||||
@@ -855,8 +855,8 @@ pub const BorderHandler = struct {
|
||||
logical_shorthand_supported: bool,
|
||||
|
||||
inline fn logicalProp(f: *FlushContext, comptime ltr: []const u8, comptime ltr_key: []const u8, comptime rtl: []const u8, comptime rtl_key: []const u8, val: anytype) void {
|
||||
_ = ltr_key; // autofix
|
||||
_ = rtl_key; // autofix
|
||||
_ = ltr_key;
|
||||
_ = rtl_key;
|
||||
f.ctx.addLogicalRule(f.ctx.allocator, @unionInit(css.Property, ltr, val.deepClone(f.ctx.allocator)), @unionInit(css.Property, rtl, val.deepClone(f.ctx.allocator)));
|
||||
}
|
||||
|
||||
@@ -1413,7 +1413,7 @@ pub const BorderHandler = struct {
|
||||
|
||||
const prop = struct {
|
||||
inline fn prop(self: *BorderHandler, d: *css.DeclarationList, c: *css.PropertyHandlerContext, up: *const UnparsedProperty, comptime id: []const u8) void {
|
||||
_ = d; // autofix
|
||||
_ = d;
|
||||
var upppppppppp = up.withPropertyId(c.allocator, @unionInit(css.PropertyId, id, {}));
|
||||
c.addUnparsedFallbacks(&upppppppppp);
|
||||
bun.bits.insert(BorderProperty, &self.flushed_properties, @field(BorderProperty, id));
|
||||
|
||||
@@ -843,7 +843,7 @@ pub const FlexHandler = struct {
|
||||
ctx: *css.PropertyHandlerContext,
|
||||
comptime feature_name: []const u8,
|
||||
) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
if (key) |value| {
|
||||
const val = value[0];
|
||||
var prefix = value[1];
|
||||
@@ -903,7 +903,7 @@ pub const FlexHandler = struct {
|
||||
}
|
||||
|
||||
fn legacyProperty(this: *FlexHandler, comptime field_name: []const u8, key: anytype, dest: *css.DeclarationList, ctx: *css.PropertyHandlerContext) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
if (key) |value| {
|
||||
const val = value[0];
|
||||
const prefix = value[1];
|
||||
|
||||
@@ -747,8 +747,8 @@ pub fn NewSizeHandler(
|
||||
dest: *css.DeclarationList,
|
||||
context: *css.PropertyHandlerContext,
|
||||
) void {
|
||||
_ = this; // autofix
|
||||
_ = dest; // autofix
|
||||
_ = this;
|
||||
_ = dest;
|
||||
if (val.*) |*_v| {
|
||||
if (@as(css.PropertyIdTag, _v.*) == logical) {
|
||||
const v = &@field(_v, @tagName(logical));
|
||||
@@ -785,7 +785,7 @@ pub fn NewSizeHandler(
|
||||
dest: *css.DeclarationList,
|
||||
context: *css.PropertyHandlerContext,
|
||||
) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
const shorthand_supported = logical_supported and if (comptime shorthand_extra != null) !context.shouldCompileLogical(shorthand_extra.?.shorthand_feature) else true;
|
||||
|
||||
if (start.* != null and @as(PropertyIdTag, start.*.?) == start_prop and
|
||||
@@ -823,7 +823,7 @@ pub fn NewSizeHandler(
|
||||
dest: *css.DeclarationList,
|
||||
context: *css.PropertyHandlerContext,
|
||||
) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
if (val.*) |*v| {
|
||||
if (@as(css.PropertyIdTag, v.*) == logical) {
|
||||
dest.append(
|
||||
|
||||
@@ -147,13 +147,13 @@ pub const CSSWideKeyword = enum {
|
||||
// .fields = union_fields,
|
||||
// };
|
||||
// };
|
||||
// _ = PropertyT; // autofix
|
||||
// _ = PropertyT;
|
||||
// return struct {
|
||||
// pub const PropertyId = PropertyIdT;
|
||||
|
||||
// pub fn propertyIdEq(lhs: PropertyId, rhs: PropertyId) bool {
|
||||
// _ = lhs; // autofix
|
||||
// _ = rhs; // autofix
|
||||
// _ = lhs;
|
||||
// _ = rhs;
|
||||
// @compileError(css.todo_stuff.depth);
|
||||
// }
|
||||
|
||||
@@ -172,13 +172,13 @@ pub const CSSWideKeyword = enum {
|
||||
|
||||
// /// PropertyId.prefix()
|
||||
// pub fn propertyIdPrefix(id: PropertyId) css.VendorPrefix {
|
||||
// _ = id; // autofix
|
||||
// _ = id;
|
||||
// @compileError(css.todo_stuff.depth);
|
||||
// }
|
||||
|
||||
// /// PropertyId.name()
|
||||
// pub fn propertyIdName(id: PropertyId) []const u8 {
|
||||
// _ = id; // autofix
|
||||
// _ = id;
|
||||
// @compileError(css.todo_stuff.depth);
|
||||
// }
|
||||
|
||||
|
||||
@@ -665,7 +665,7 @@ pub const FontFaceDeclarationParser = struct {
|
||||
pub const Declaration = FontFaceProperty;
|
||||
|
||||
pub fn parseValue(this: *This, name: []const u8, input: *css.Parser) Result(Declaration) {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
const state = input.state();
|
||||
// todo_stuff.match_ignore_ascii_case
|
||||
if (bun.strings.eqlCaseInsensitiveASCIIICheckLength(name, "src")) {
|
||||
@@ -721,12 +721,12 @@ pub const FontFaceDeclarationParser = struct {
|
||||
|
||||
pub const RuleBodyItemParser = struct {
|
||||
pub fn parseQualified(this: *This) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return false;
|
||||
}
|
||||
|
||||
pub fn parseDeclarations(this: *This) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -207,7 +207,7 @@ pub const FontPaletteValuesDeclarationParser = struct {
|
||||
pub const Declaration = FontPaletteValuesProperty;
|
||||
|
||||
pub fn parseValue(this: *This, name: []const u8, input: *css.Parser) Result(Declaration) {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
const state = input.state();
|
||||
// todo_stuff.match_ignore_ascii_case
|
||||
if (bun.strings.eqlCaseInsensitiveASCIIICheckLength("font-family", name)) {
|
||||
|
||||
@@ -171,7 +171,7 @@ pub const KeyframeSelector = union(enum) {
|
||||
pub const parse = css.DeriveParse(@This()).parse;
|
||||
|
||||
// pub fn parse(input: *css.Parser) Result(KeyframeSelector) {
|
||||
// _ = input; // autofix
|
||||
// _ = input;
|
||||
// @panic(css.todo_stuff.depth);
|
||||
// }
|
||||
|
||||
@@ -287,8 +287,8 @@ pub const KeyframesRule = struct {
|
||||
}
|
||||
|
||||
pub fn getFallbacks(this: *This, comptime T: type, targets: *const css.targets.Targets) []css.CssRule(T) {
|
||||
_ = this; // autofix
|
||||
_ = targets; // autofix
|
||||
_ = this;
|
||||
_ = targets;
|
||||
@compileError(css.todo_stuff.depth);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,13 +124,13 @@ pub fn CssRuleList(comptime AtRule: type) type {
|
||||
|
||||
pub fn minify(this: *This, context: *MinifyContext, parent_is_unused: bool) css.MinifyErr!void {
|
||||
// var keyframe_rules: keyframes.KeyframesName.HashMap(usize) = .{};
|
||||
// _ = keyframe_rules; // autofix
|
||||
// _ = keyframe_rules;
|
||||
// const layer_rules: layer.LayerName.HashMap(usize) = .{};
|
||||
// _ = layer_rules; // autofix
|
||||
// _ = layer_rules;
|
||||
// const property_rules: css.css_values.ident.DashedIdent.HashMap(usize) = .{};
|
||||
// _ = property_rules; // autofix
|
||||
// _ = property_rules;
|
||||
var style_rules = StyleRuleKey(AtRule).HashMap(usize){};
|
||||
// _ = style_rules; // autofix
|
||||
// _ = style_rules;
|
||||
var rules = ArrayList(CssRule(AtRule)){};
|
||||
|
||||
for (this.v.items) |*rule| {
|
||||
@@ -143,7 +143,7 @@ pub fn CssRuleList(comptime AtRule: type) type {
|
||||
|
||||
switch (rule.*) {
|
||||
.keyframes => |*keyframez| {
|
||||
_ = keyframez; // autofix
|
||||
_ = keyframez;
|
||||
// if (context.unused_symbols.contains(switch (keyframez.name) {
|
||||
// .ident => |ident| ident.v,
|
||||
// .custom => |custom| custom,
|
||||
@@ -212,19 +212,19 @@ pub fn CssRuleList(comptime AtRule: type) type {
|
||||
if (supp.rules.v.items.len == 0) continue;
|
||||
},
|
||||
.container => |*cont| {
|
||||
_ = cont; // autofix
|
||||
_ = cont;
|
||||
debug("TODO: ContainerRule", .{});
|
||||
},
|
||||
.layer_block => |*lay| {
|
||||
_ = lay; // autofix
|
||||
_ = lay;
|
||||
debug("TODO: LayerBlockRule", .{});
|
||||
},
|
||||
.layer_statement => |*lay| {
|
||||
_ = lay; // autofix
|
||||
_ = lay;
|
||||
debug("TODO: LayerStatementRule", .{});
|
||||
},
|
||||
.moz_document => |*doc| {
|
||||
_ = doc; // autofix
|
||||
_ = doc;
|
||||
debug("TODO: MozDocumentRule", .{});
|
||||
},
|
||||
.style => |*sty| {
|
||||
@@ -292,7 +292,7 @@ pub fn CssRuleList(comptime AtRule: type) type {
|
||||
if (mergeStyleRules(AtRule, &b[0].style, &a[len - 2].style, context)) {
|
||||
// If we were able to merge the last rule into the previous one, remove the last.
|
||||
const popped = rules.pop();
|
||||
_ = popped; // autofix
|
||||
_ = popped;
|
||||
// TODO: deinit?
|
||||
// popped.deinit(contet.allocator);
|
||||
continue;
|
||||
@@ -425,27 +425,27 @@ pub fn CssRuleList(comptime AtRule: type) type {
|
||||
continue;
|
||||
},
|
||||
.counter_style => |*cntr| {
|
||||
_ = cntr; // autofix
|
||||
_ = cntr;
|
||||
debug("TODO: CounterStyleRule", .{});
|
||||
},
|
||||
.scope => |*scpe| {
|
||||
_ = scpe; // autofix
|
||||
_ = scpe;
|
||||
debug("TODO: ScopeRule", .{});
|
||||
},
|
||||
.nesting => |*nst| {
|
||||
_ = nst; // autofix
|
||||
_ = nst;
|
||||
debug("TODO: NestingRule", .{});
|
||||
},
|
||||
.starting_style => |*rl| {
|
||||
_ = rl; // autofix
|
||||
_ = rl;
|
||||
debug("TODO: StartingStyleRule", .{});
|
||||
},
|
||||
.font_palette_values => |*f| {
|
||||
_ = f; // autofix
|
||||
_ = f;
|
||||
debug("TODO: FontPaletteValuesRule", .{});
|
||||
},
|
||||
.property => |*prop| {
|
||||
_ = prop; // autofix
|
||||
_ = prop;
|
||||
debug("TODO: PropertyRule", .{});
|
||||
},
|
||||
else => {},
|
||||
|
||||
@@ -119,12 +119,12 @@ pub const SupportsCondition = union(enum) {
|
||||
usize,
|
||||
struct {
|
||||
pub fn hash(self: @This(), s: SeenDeclKey) u32 {
|
||||
_ = self; // autofix
|
||||
_ = self;
|
||||
return std.array_hash_map.hashString(s[1]) +% @intFromEnum(s[0]);
|
||||
}
|
||||
pub fn eql(self: @This(), a: SeenDeclKey, b: SeenDeclKey, b_index: usize) bool {
|
||||
_ = self; // autofix
|
||||
_ = b_index; // autofix
|
||||
_ = self;
|
||||
_ = b_index;
|
||||
return seenDeclKeyEql(a, b);
|
||||
}
|
||||
|
||||
@@ -403,9 +403,9 @@ pub fn SupportsRule(comptime R: type) type {
|
||||
}
|
||||
|
||||
pub fn minify(this: *This, context: *css.MinifyContext, parent_is_unused: bool) css.MinifyErr!void {
|
||||
_ = this; // autofix
|
||||
_ = context; // autofix
|
||||
_ = parent_is_unused; // autofix
|
||||
_ = this;
|
||||
_ = context;
|
||||
_ = parent_is_unused;
|
||||
// TODO: Implement this
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ pub const SelectorParser = struct {
|
||||
}
|
||||
|
||||
pub fn namespaceForPrefix(this: *SelectorParser, prefix: css.css_values.ident.Ident) ?[]const u8 {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return prefix.v;
|
||||
}
|
||||
|
||||
@@ -1097,7 +1097,7 @@ pub const SelectorParser = struct {
|
||||
}
|
||||
|
||||
fn parseIsAndWhere(this: *const SelectorParser) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1310,23 +1310,23 @@ pub const SelectorParser = struct {
|
||||
}
|
||||
|
||||
pub fn defaultNamespace(this: *SelectorParser) ?impl.Selectors.SelectorImpl.NamespaceUrl {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return null;
|
||||
}
|
||||
|
||||
pub fn parsePart(this: *SelectorParser) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return true;
|
||||
}
|
||||
|
||||
pub fn parseSlotted(this: *SelectorParser) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// The error recovery that selector lists inside :is() and :where() have.
|
||||
fn isAndWhereErrorRecovery(this: *SelectorParser) ParseErrorRecovery {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
return .ignore_invalid_selector;
|
||||
}
|
||||
|
||||
@@ -1386,8 +1386,8 @@ pub fn GenericSelectorList(comptime Impl: type) type {
|
||||
|
||||
pub fn format(this: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
if (comptime !bun.Environment.isDebug) return;
|
||||
_ = fmt; // autofix
|
||||
_ = options; // autofix
|
||||
_ = fmt;
|
||||
_ = options;
|
||||
try writer.print("SelectorList[\n", .{});
|
||||
const last = this.this.v.len() -| 1;
|
||||
for (this.this.v.slice(), 0..) |*sel, i| {
|
||||
@@ -1424,8 +1424,8 @@ pub fn GenericSelectorList(comptime Impl: type) type {
|
||||
}
|
||||
|
||||
pub fn toCss(this: *const This, comptime W: type, dest: *Printer(W)) PrintErr!void {
|
||||
_ = this; // autofix
|
||||
_ = dest; // autofix
|
||||
_ = this;
|
||||
_ = dest;
|
||||
@compileError("Do not call this! Use `serializer.serializeSelectorList()` or `tocss_servo.toCss_SelectorList()` instead.");
|
||||
}
|
||||
|
||||
@@ -1625,8 +1625,8 @@ pub fn GenericSelector(comptime Impl: type) type {
|
||||
|
||||
pub fn format(this: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
if (comptime !bun.Environment.isDebug) return;
|
||||
_ = fmt; // autofix
|
||||
_ = options; // autofix
|
||||
_ = fmt;
|
||||
_ = options;
|
||||
try writer.print("Selector(", .{});
|
||||
var arraylist = ArrayList(u8){};
|
||||
const w = arraylist.writer(bun.default_allocator);
|
||||
@@ -1654,8 +1654,8 @@ pub fn GenericSelector(comptime Impl: type) type {
|
||||
}
|
||||
|
||||
pub fn toCss(this: *const This, comptime W: type, dest: *Printer(W)) PrintErr!void {
|
||||
_ = this; // autofix
|
||||
_ = dest; // autofix
|
||||
_ = this;
|
||||
_ = dest;
|
||||
@compileError("Do not call this! Use `serializer.serializeSelector()` or `tocss_servo.toCss_Selector()` instead.");
|
||||
}
|
||||
|
||||
@@ -1949,8 +1949,8 @@ pub fn GenericComponent(comptime Impl: type) type {
|
||||
}
|
||||
|
||||
pub fn toCss(this: *const This, comptime W: type, dest: *Printer(W)) PrintErr!void {
|
||||
_ = this; // autofix
|
||||
_ = dest; // autofix
|
||||
_ = this;
|
||||
_ = dest;
|
||||
@compileError("Do not call this! Use `serializer.serializeComponent()` or `tocss_servo.toCss_Component()` instead.");
|
||||
}
|
||||
|
||||
@@ -2241,8 +2241,8 @@ pub const Combinator = enum {
|
||||
}
|
||||
|
||||
pub fn toCss(this: *const @This(), comptime W: type, dest: *Printer(W)) PrintErr!void {
|
||||
_ = this; // autofix
|
||||
_ = dest; // autofix
|
||||
_ = this;
|
||||
_ = dest;
|
||||
@compileError("Do not call this! Use `serializer.serializeCombinator()` or `tocss_servo.toCss_Combinator()` instead.");
|
||||
}
|
||||
|
||||
@@ -2496,7 +2496,7 @@ pub const PseudoElement = union(enum) {
|
||||
}
|
||||
|
||||
pub fn acceptsStatePseudoClasses(this: *const PseudoElement) bool {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
// Be lienient.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ pub fn SmallList(comptime T: type, comptime N: comptime_int) type {
|
||||
|
||||
pub fn orderedRemove(this: *@This(), idx: u32) T {
|
||||
var ptr, const len_ptr, const capp = this.tripleMut();
|
||||
_ = capp; // autofix
|
||||
_ = capp;
|
||||
bun.assert(idx < len_ptr.*);
|
||||
|
||||
const length = len_ptr.*;
|
||||
@@ -379,7 +379,7 @@ pub fn SmallList(comptime T: type, comptime N: comptime_int) type {
|
||||
|
||||
pub fn swapRemove(this: *@This(), idx: u32) T {
|
||||
var ptr, const len_ptr, const capp = this.tripleMut();
|
||||
_ = capp; // autofix
|
||||
_ = capp;
|
||||
bun.assert(idx < len_ptr.*);
|
||||
|
||||
const ret = ptr[idx];
|
||||
@@ -570,7 +570,7 @@ pub fn SmallList(comptime T: type, comptime N: comptime_int) type {
|
||||
|
||||
fn reserve(this: *@This(), allocator: Allocator, additional: u32) void {
|
||||
const ptr, const __len, const capp = this.tripleMut();
|
||||
_ = ptr; // autofix
|
||||
_ = ptr;
|
||||
const len_ = __len.*;
|
||||
|
||||
if (capp - len_ >= additional) return;
|
||||
|
||||
@@ -798,7 +798,7 @@ pub fn parseRGBComponents(input: *css.Parser, parser: *ComponentParser) Result(s
|
||||
}
|
||||
|
||||
pub fn parseHSLHWBComponents(comptime T: type, input: *css.Parser, parser: *ComponentParser, allows_legacy: bool) Result(struct { f32, f32, f32, bool }) {
|
||||
_ = T; // autofix
|
||||
_ = T;
|
||||
const h = switch (parseAngleOrNumber(input, parser)) {
|
||||
.result => |v| v,
|
||||
.err => |e| return .{ .err = e },
|
||||
@@ -966,7 +966,7 @@ pub fn parseLch(
|
||||
}
|
||||
|
||||
pub fn parseRelativeFn(i: *css.Parser, p: *ComponentParser, this: *@This()) Result(CssColor) {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
if (p.from) |*from| {
|
||||
// Relative angles should be normalized.
|
||||
// https://www.w3.org/TR/css-color-5/#relative-LCH
|
||||
@@ -1069,7 +1069,7 @@ pub fn parseHslHwbComponents(
|
||||
parser: *ComponentParser,
|
||||
allows_legacy: bool,
|
||||
) Result(struct { f32, f32, f32, bool }) {
|
||||
_ = T; // autofix
|
||||
_ = T;
|
||||
const h = switch (parseAngleOrNumber(input, parser)) {
|
||||
.result => |vv| vv,
|
||||
.err => |e| return .{ .err = e },
|
||||
@@ -1132,7 +1132,7 @@ fn parseRgb(input: *css.Parser, parser: *ComponentParser) Result(CssColor) {
|
||||
}
|
||||
|
||||
pub fn parseRelativeFn(i: *css.Parser, p: *ComponentParser, this: *@This()) Result(CssColor) {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
const r, const g, const b, const is_legacy = switch (parseRGBComponents(i, p)) {
|
||||
.result => |vv| vv,
|
||||
.err => |e| return .{ .err = e },
|
||||
|
||||
@@ -185,13 +185,13 @@ pub const Image = union(enum) {
|
||||
}
|
||||
|
||||
// pub fn parse(input: *css.Parser) Result(Image) {
|
||||
// _ = input; // autofix
|
||||
// _ = input;
|
||||
// @panic(css.todo_stuff.depth);
|
||||
// }
|
||||
|
||||
// pub fn toCss(this: *const Image, comptime W: type, dest: *css.Printer(W)) css.PrintErr!void {
|
||||
// _ = this; // autofix
|
||||
// _ = dest; // autofix
|
||||
// _ = this;
|
||||
// _ = dest;
|
||||
// @panic(css.todo_stuff.depth);
|
||||
// }
|
||||
};
|
||||
|
||||
@@ -444,13 +444,13 @@ pub const NumberOrPercentage = union(enum) {
|
||||
pub const toCss = css.DeriveToCss(@This()).toCss;
|
||||
|
||||
// pub fn parse(input: *css.Parser) Result(NumberOrPercentage) {
|
||||
// _ = input; // autofix
|
||||
// _ = input;
|
||||
// @panic(css.todo_stuff.depth);
|
||||
// }
|
||||
|
||||
// pub fn toCss(this: *const NumberOrPercentage, comptime W: type, dest: *css.Printer(W)) css.PrintErr!void {
|
||||
// _ = this; // autofix
|
||||
// _ = dest; // autofix
|
||||
// _ = this;
|
||||
// _ = dest;
|
||||
// @panic(css.todo_stuff.depth);
|
||||
// }
|
||||
|
||||
|
||||
@@ -442,7 +442,7 @@ pub const Parser = struct {
|
||||
}
|
||||
|
||||
fn commitRopePart(this: *Parser, arena_allocator: Allocator, ropealloc: Allocator, unesc: *std.ArrayList(u8), existing_rope: *?*Rope) OOM!void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
const slice = try arena_allocator.dupe(u8, unesc.items[0..]);
|
||||
const expr = Expr.init(E.String, E.String{ .data = slice }, Loc.Empty);
|
||||
if (existing_rope.*) |_r| {
|
||||
|
||||
@@ -697,7 +697,7 @@ pub const PackageInstaller = struct {
|
||||
}
|
||||
|
||||
fn getPatchfileHash(patchfile_path: []const u8) ?u64 {
|
||||
_ = patchfile_path; // autofix
|
||||
_ = patchfile_path;
|
||||
}
|
||||
|
||||
pub fn installPackageWithNameAndResolution(
|
||||
|
||||
@@ -758,7 +758,7 @@ fn overwritePackageInNodeModulesFolder(
|
||||
var copy_file_state: bun.CopyFileState = .{};
|
||||
var pathbuf: bun.PathBuffer = undefined;
|
||||
var pathbuf2: bun.PathBuffer = undefined;
|
||||
// _ = pathbuf; // autofix
|
||||
// _ = pathbuf;
|
||||
|
||||
while (try walker.next().unwrap()) |entry| {
|
||||
if (entry.kind != .file) continue;
|
||||
|
||||
@@ -41,8 +41,7 @@ pub fn runTasks(
|
||||
if (ptask.callback.apply.logger.errors == 0) {
|
||||
if (comptime @TypeOf(callbacks.onExtract) != void) {
|
||||
if (ptask.callback.apply.task_id) |task_id| {
|
||||
_ = task_id; // autofix
|
||||
|
||||
_ = task_id;
|
||||
} else if (Ctx == *PackageInstaller) {
|
||||
if (ptask.callback.apply.install_context) |*ctx| {
|
||||
var installer: *PackageInstaller = extract_ctx;
|
||||
|
||||
@@ -130,7 +130,7 @@ pub const PatchTask = struct {
|
||||
}
|
||||
|
||||
pub fn runFromMainThreadApply(this: *PatchTask, manager: *PackageManager) void {
|
||||
_ = manager; // autofix
|
||||
_ = manager;
|
||||
if (this.callback.apply.logger.errors > 0) {
|
||||
defer this.callback.apply.logger.deinit();
|
||||
Output.errGeneric("failed to apply patchfile ({s})", .{this.callback.apply.patchfilepath});
|
||||
|
||||
@@ -182,7 +182,7 @@ const PosixBufferedReader = struct {
|
||||
|
||||
// No-op on posix.
|
||||
pub fn pause(this: *PosixBufferedReader) void {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
}
|
||||
|
||||
pub fn takeBuffer(this: *PosixBufferedReader) std.ArrayList(u8) {
|
||||
@@ -208,12 +208,12 @@ const PosixBufferedReader = struct {
|
||||
}
|
||||
|
||||
pub fn disableKeepingProcessAlive(this: *@This(), event_loop_ctx: anytype) void {
|
||||
_ = event_loop_ctx; // autofix
|
||||
_ = event_loop_ctx;
|
||||
this.updateRef(false);
|
||||
}
|
||||
|
||||
pub fn enableKeepingProcessAlive(this: *@This(), event_loop_ctx: anytype) void {
|
||||
_ = event_loop_ctx; // autofix
|
||||
_ = event_loop_ctx;
|
||||
this.updateRef(true);
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ const PosixBufferedReader = struct {
|
||||
}
|
||||
|
||||
fn readWithFn(parent: *PosixBufferedReader, resizable_buffer: *std.ArrayList(u8), fd: bun.FileDescriptor, size_hint: isize, received_hup: bool, comptime file_type: FileType, comptime sys_fn: *const fn (bun.FileDescriptor, []u8, usize) bun.sys.Maybe(usize)) void {
|
||||
_ = size_hint; // autofix
|
||||
_ = size_hint;
|
||||
const streaming = parent.vtable.isStreamingEnabled();
|
||||
|
||||
if (streaming) {
|
||||
|
||||
@@ -130,7 +130,7 @@ pub fn PosixPipeWriter(
|
||||
}
|
||||
|
||||
pub fn drainBufferedData(parent: *This, buf: []const u8, max_write_size: usize, received_hup: bool) WriteResult {
|
||||
_ = received_hup; // autofix
|
||||
_ = received_hup;
|
||||
|
||||
const trimmed = if (max_write_size < buf.len and max_write_size > 0) buf[0..max_write_size] else buf;
|
||||
|
||||
|
||||
@@ -293,13 +293,13 @@ const Opts = struct {
|
||||
}
|
||||
|
||||
pub fn parseLong(this: *Opts, flag: []const u8) ?ParseFlagResult {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
_ = flag;
|
||||
return null;
|
||||
}
|
||||
|
||||
pub fn parseShort(this: *Opts, char: u8, smallflags: []const u8, i: usize) ?ParseFlagResult {
|
||||
_ = this; // autofix
|
||||
_ = this;
|
||||
switch (char) {
|
||||
'b' => {
|
||||
return .{ .unsupported = unsupportedFlag("-b") };
|
||||
|
||||
@@ -190,8 +190,8 @@ pub const ShellMkdirTask = struct {
|
||||
}
|
||||
|
||||
pub fn format(this: *const ShellMkdirTask, comptime fmt_: []const u8, options_: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
_ = fmt_; // autofix
|
||||
_ = options_; // autofix
|
||||
_ = fmt_;
|
||||
_ = options_;
|
||||
try writer.print("ShellMkdirTask(0x{x}, filepath={s})", .{ @intFromPtr(this), this.filepath });
|
||||
}
|
||||
|
||||
|
||||
@@ -952,21 +952,21 @@ pub const ShellRmTask = struct {
|
||||
var dummy: @This() = std.mem.zeroes(@This());
|
||||
|
||||
pub fn onIsDir(this: *@This(), parent_dir_task: *DirTask, path: [:0]const u8, is_absolute: bool, buf: *bun.PathBuffer) Maybe(void) {
|
||||
_ = this; // autofix
|
||||
_ = parent_dir_task; // autofix
|
||||
_ = path; // autofix
|
||||
_ = is_absolute; // autofix
|
||||
_ = buf; // autofix
|
||||
_ = this;
|
||||
_ = parent_dir_task;
|
||||
_ = path;
|
||||
_ = is_absolute;
|
||||
_ = buf;
|
||||
|
||||
return .success;
|
||||
}
|
||||
|
||||
pub fn onDirNotEmpty(this: *@This(), parent_dir_task: *DirTask, path: [:0]const u8, is_absolute: bool, buf: *bun.PathBuffer) Maybe(void) {
|
||||
_ = this; // autofix
|
||||
_ = parent_dir_task; // autofix
|
||||
_ = path; // autofix
|
||||
_ = is_absolute; // autofix
|
||||
_ = buf; // autofix
|
||||
_ = this;
|
||||
_ = parent_dir_task;
|
||||
_ = path;
|
||||
_ = is_absolute;
|
||||
_ = buf;
|
||||
|
||||
return .success;
|
||||
}
|
||||
@@ -997,18 +997,18 @@ pub const ShellRmTask = struct {
|
||||
enqueued: bool = false,
|
||||
|
||||
pub fn onIsDir(this: *@This(), parent_dir_task: *DirTask, path: [:0]const u8, is_absolute: bool, buf: *bun.PathBuffer) Maybe(void) {
|
||||
_ = parent_dir_task; // autofix
|
||||
_ = path; // autofix
|
||||
_ = is_absolute; // autofix
|
||||
_ = buf; // autofix
|
||||
_ = parent_dir_task;
|
||||
_ = path;
|
||||
_ = is_absolute;
|
||||
_ = buf;
|
||||
|
||||
this.treat_as_dir = true;
|
||||
return .success;
|
||||
}
|
||||
|
||||
pub fn onDirNotEmpty(this: *@This(), parent_dir_task: *DirTask, path: [:0]const u8, is_absolute: bool, buf: *bun.PathBuffer) Maybe(void) {
|
||||
_ = is_absolute; // autofix
|
||||
_ = buf; // autofix
|
||||
_ = is_absolute;
|
||||
_ = buf;
|
||||
|
||||
this.treat_as_dir = true;
|
||||
if (this.allow_enqueue) {
|
||||
|
||||
@@ -18,8 +18,8 @@ state: union(enum) {
|
||||
} = .idle,
|
||||
|
||||
pub fn format(this: *const Touch, comptime fmt: []const u8, opts: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
_ = fmt; // autofix
|
||||
_ = opts; // autofix
|
||||
_ = fmt;
|
||||
_ = opts;
|
||||
try writer.print("Touch(0x{x}, state={s})", .{ @intFromPtr(this), @tagName(this.state) });
|
||||
}
|
||||
|
||||
@@ -179,8 +179,8 @@ pub const ShellTouchTask = struct {
|
||||
concurrent_task: jsc.EventLoopTask,
|
||||
|
||||
pub fn format(this: *const ShellTouchTask, comptime fmt: []const u8, opts: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
_ = fmt; // autofix
|
||||
_ = opts; // autofix
|
||||
_ = fmt;
|
||||
_ = opts;
|
||||
try writer.print("ShellTouchTask(0x{x}, filepath={s})", .{ @intFromPtr(this), this.filepath });
|
||||
}
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@ pub const Interpreter = struct {
|
||||
|
||||
/// NOTE: This will `.ref()` value, so you should `defer value.deref()` it before handing it to this function.
|
||||
pub fn assignVar(this: *ShellExecEnv, interp: *ThisInterpreter, label: EnvStr, value: EnvStr, assign_ctx: AssignCtx) void {
|
||||
_ = interp; // autofix
|
||||
_ = interp;
|
||||
switch (assign_ctx) {
|
||||
.cmd => this.cmd_local_env.insert(label, value),
|
||||
.shell => this.shell_env.insert(label, value),
|
||||
@@ -1088,7 +1088,7 @@ pub const Interpreter = struct {
|
||||
|
||||
pub fn runFromJS(this: *ThisInterpreter, globalThis: *JSGlobalObject, callframe: *jsc.CallFrame) bun.JSError!JSValue {
|
||||
log("Interpreter(0x{x}) runFromJS", .{@intFromPtr(this)});
|
||||
_ = callframe; // autofix
|
||||
_ = callframe;
|
||||
|
||||
if (this.setupIOBeforeRun().asErr()) |e| {
|
||||
defer this.deinitEverything();
|
||||
@@ -1267,8 +1267,8 @@ pub const Interpreter = struct {
|
||||
}
|
||||
|
||||
pub fn getStarted(this: *ThisInterpreter, globalThis: *JSGlobalObject, callframe: *jsc.CallFrame) bun.JSError!jsc.JSValue {
|
||||
_ = globalThis; // autofix
|
||||
_ = callframe; // autofix
|
||||
_ = globalThis;
|
||||
_ = callframe;
|
||||
|
||||
return jsc.JSValue.jsBoolean(this.started.load(.seq_cst));
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ pub const ShellAsyncSubprocessDone = struct {
|
||||
concurrent_task: jsc.EventLoopTask,
|
||||
|
||||
pub fn format(this: *const ShellAsyncSubprocessDone, comptime fmt: []const u8, opts: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
_ = fmt; // autofix
|
||||
_ = opts; // autofix
|
||||
_ = fmt;
|
||||
_ = opts;
|
||||
try writer.print("ShellAsyncSubprocessDone(0x{x}, cmd=0{x})", .{ @intFromPtr(this), @intFromPtr(this.cmd) });
|
||||
}
|
||||
|
||||
|
||||
@@ -714,7 +714,7 @@ fn expansionSizeHintSimple(this: *const Expansion, simple: *const ast.SimpleAtom
|
||||
.brace_begin, .brace_end, .comma, .asterisk => 1,
|
||||
.double_asterisk => 2,
|
||||
.cmd_subst => |subst| {
|
||||
_ = subst; // autofix
|
||||
_ = subst;
|
||||
|
||||
// TODO check if the command substitution is comprised entirely of assignments or zero-sized things
|
||||
// if (@as(ast.CmdOrAssigns.Tag, subst.*) == .assigns) {
|
||||
|
||||
@@ -136,7 +136,7 @@ pub const ShellSubprocess = struct {
|
||||
switch (pipe.writer.startWithCurrentPipe()) {
|
||||
.result => {},
|
||||
.err => |err| {
|
||||
_ = err; // autofix
|
||||
_ = err;
|
||||
pipe.deref();
|
||||
return error.UnexpectedCreatingStdin;
|
||||
},
|
||||
@@ -343,9 +343,9 @@ pub const ShellSubprocess = struct {
|
||||
}
|
||||
|
||||
pub fn init(out_type: bun.shell.Subprocess.OutKind, stdio: Stdio, shellio: ?*sh.IOWriter, event_loop: jsc.EventLoopHandle, process: *ShellSubprocess, result: StdioResult, allocator: std.mem.Allocator, max_size: u32, is_sync: bool) Readable {
|
||||
_ = allocator; // autofix
|
||||
_ = max_size; // autofix
|
||||
_ = is_sync; // autofix
|
||||
_ = allocator;
|
||||
_ = max_size;
|
||||
_ = is_sync;
|
||||
|
||||
assertStdioResult(result);
|
||||
|
||||
@@ -1280,7 +1280,7 @@ pub const PipeReader = struct {
|
||||
return jsc.WebCore.ReadableStream.fromOwnedSlice(globalObject, bytes, 0);
|
||||
},
|
||||
.err => |err| {
|
||||
_ = err; // autofix
|
||||
_ = err;
|
||||
const empty = try jsc.WebCore.ReadableStream.empty(globalObject);
|
||||
jsc.WebCore.ReadableStream.cancel(&jsc.WebCore.ReadableStream.fromJS(empty, globalObject).?, globalObject);
|
||||
return empty;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
".jsBoolean(true)": 0,
|
||||
".stdDir()": 41,
|
||||
".stdFile()": 17,
|
||||
"// autofix": 166,
|
||||
"// autofix": 0,
|
||||
": [^=]+= undefined,$": 256,
|
||||
"== alloc.ptr": 0,
|
||||
"== allocator.ptr": 0,
|
||||
|
||||
Reference in New Issue
Block a user