diff options
author | 2023-02-23 23:57:19 -0800 | |
---|---|---|
committer | 2023-02-23 23:57:19 -0800 | |
commit | 3f04f8d0a653cf5decef2225c2044742b382718a (patch) | |
tree | 91eb6500834e3157ecb9ab208101aa368a1191c8 /src/bun.js/base.zig | |
parent | b5bdde28ed34070cbb1d34d13f414f4c513ee40d (diff) | |
download | bun-3f04f8d0a653cf5decef2225c2044742b382718a.tar.gz bun-3f04f8d0a653cf5decef2225c2044742b382718a.tar.zst bun-3f04f8d0a653cf5decef2225c2044742b382718a.zip |
Upgrade Zig (#2151)
* fixup
* Upgrade Zig
* Remove bad assertion
* strings
* bump
* mode -> optimize
* optimize
* Linux build
* Update bindgen.zig
Diffstat (limited to 'src/bun.js/base.zig')
-rw-r--r-- | src/bun.js/base.zig | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig index bdb516836..044a04306 100644 --- a/src/bun.js/base.zig +++ b/src/bun.js/base.zig @@ -219,7 +219,7 @@ pub const To = struct { var zig_strings = allocator.alloc(ZigString, value.len) catch unreachable; defer if (stack_fallback.fixed_buffer_allocator.end_index >= 511) allocator.free(zig_strings); - for (value) |path_string, i| { + for (value, 0..) |path_string, i| { if (comptime Type == []const PathString) { zig_strings[i] = ZigString.init(path_string.slice()); } else { @@ -645,7 +645,7 @@ pub const d = struct { comptime { var args: string = ""; - for (func.args) |a, i| { + for (func.args, 0..) |a, i| { if (i > 0) { args = args ++ ", "; } @@ -680,7 +680,7 @@ pub const d = struct { comptime { var args: string = ""; - for (func.args) |a, i| { + for (func.args, 0..) |a, i| { if (i > 0) { args = args ++ ", "; } @@ -751,7 +751,7 @@ pub const d = struct { indent += indent_level; - for (klass.properties) |property, i| { + for (klass.properties, 0..) |property, i| { if (i > 0) { buf = buf ++ "\n"; } @@ -761,7 +761,7 @@ pub const d = struct { buf = buf ++ "\n"; - for (klass.functions) |func, i| { + for (klass.functions, 0..) |func, i| { if (i > 0) { buf = buf ++ "\n"; } @@ -773,7 +773,7 @@ pub const d = struct { ); } - for (klass.classes) |func, i| { + for (klass.classes, 0..) |func, i| { if (i > 0) { buf = buf ++ "\n"; } @@ -822,7 +822,7 @@ pub const d = struct { ); } - for (klass.properties) |property, i| { + for (klass.properties, 0..) |property, i| { if (i > 0 or did_print_constructor) { buf = buf ++ "\n"; } @@ -832,7 +832,7 @@ pub const d = struct { buf = buf ++ "\n"; - for (klass.functions) |func, i| { + for (klass.functions, 0..) |func, i| { if (i > 0) { buf = buf ++ "\n"; } @@ -1294,7 +1294,7 @@ pub fn NewClassWithInstanceType( .attributes = js.JSPropertyAttributes.kJSPropertyAttributeNone, }, ); - for (property_name_literals) |lit, i| { + for (property_name_literals, 0..) |lit, i| { props[i] = brk2: { var static_prop = JSC.C.JSStaticValue{ .name = lit.ptr[0..lit.len :0], @@ -1338,7 +1338,7 @@ pub fn NewClassWithInstanceType( .convertToType = null, }; var __static_functions: [function_name_literals.len + 1]js.JSStaticFunction = undefined; - for (__static_functions) |_, i| { + for (__static_functions, 0..) |_, i| { __static_functions[i] = js.JSStaticFunction{ .name = "", .callAsFunction = null, @@ -1692,7 +1692,7 @@ pub fn toTypeError( args: anytype, ctx: js.JSContextRef, ) JSC.JSValue { - return toTypeErrorWithCode(std.mem.span(@tagName(code)), fmt, args, ctx); + return toTypeErrorWithCode(@tagName(code), fmt, args, ctx); } pub fn throwInvalidArguments( |