diff options
Diffstat (limited to 'src/bun.js/api/JSTranspiler.zig')
-rw-r--r-- | src/bun.js/api/JSTranspiler.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bun.js/api/JSTranspiler.zig b/src/bun.js/api/JSTranspiler.zig index 95b0eeaae..5c5bee171 100644 --- a/src/bun.js/api/JSTranspiler.zig +++ b/src/bun.js/api/JSTranspiler.zig @@ -85,7 +85,7 @@ const TranspilerOptions = struct { // This is going to be hard to not leak pub const TransformTask = struct { input_code: ZigString = ZigString.init(""), - protected_input_value: JSC.JSValue = @enumFromInt(JSC.JSValue, 0), + protected_input_value: JSC.JSValue = @as(JSC.JSValue, @enumFromInt(0)), output_code: ZigString = ZigString.init(""), bundler: Bundler.Bundler = undefined, log: logger.Log, @@ -221,7 +221,7 @@ pub const TransformTask = struct { finish(this.output_code, this.global, promise); if (@intFromEnum(this.protected_input_value) != 0) { - this.protected_input_value = @enumFromInt(JSC.JSValue, 0); + this.protected_input_value = @as(JSC.JSValue, @enumFromInt(0)); } this.deinit(); } @@ -612,7 +612,7 @@ fn transformOptionsFromJSC(globalObject: JSC.C.JSContextRef, temp_allocator: std var length_iter = iter; while (length_iter.next()) |value| { if (value.isString()) { - const length = @truncate(u32, value.getLength(globalThis)); + const length = @as(u32, @truncate(value.getLength(globalThis))); string_count += @as(u32, @intFromBool(length > 0)); total_name_buf_len += length; } @@ -879,7 +879,7 @@ fn getParseResult(this: *Transpiler, allocator: std.mem.Allocator, code: []const for (res.ast.import_records.slice()) |*import| { if (import.kind.isCommonJS()) { import.do_commonjs_transform_in_printer = true; - import.module_id = @truncate(u32, bun.hash(import.path.pretty)); + import.module_id = @as(u32, @truncate(bun.hash(import.path.pretty))); } } } @@ -1218,7 +1218,7 @@ fn namedImportsToJS( array.ensureStillAlive(); const path = JSC.ZigString.init(record.path.text).toValueGC(global); const kind = JSC.ZigString.init(record.kind.label()).toValueGC(global); - array.putIndex(global, @truncate(u32, i), JSC.JSValue.createObject2(global, path_label, kind_label, path, kind)); + array.putIndex(global, @as(u32, @truncate(i)), JSC.JSValue.createObject2(global, path_label, kind_label, path, kind)); } return array; |