diff options
Diffstat (limited to 'src/js_ast.zig')
-rw-r--r-- | src/js_ast.zig | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index 7811541f4..3b17240c0 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -26,6 +26,7 @@ const is_bindgen = std.meta.globalOption("bindgen", bool) orelse false; const ComptimeStringMap = bun.ComptimeStringMap; const JSPrinter = @import("./js_printer.zig"); const js_lexer = @import("./js_lexer.zig"); +const TypeScript = @import("./js_parser.zig").TypeScript; const ThreadlocalArena = @import("./mimalloc_arena.zig").Arena; /// This is the index to the automatically-generated part containing code that @@ -834,6 +835,8 @@ pub const G = struct { // This is omitted for class fields value: ?ExprNodeIndex = null, + ts_metadata: TypeScript.Metadata = .m_none, + pub const List = BabyList(Property); pub const Kind = enum(u3) { @@ -865,6 +868,8 @@ pub const G = struct { arguments_ref: ?Ref = null, flags: Flags.Function.Set = Flags.Function.None, + + return_ts_metadata: TypeScript.Metadata = .m_none, }; pub const Arg = struct { ts_decorators: ExprNodeList = ExprNodeList{}, @@ -873,6 +878,8 @@ pub const G = struct { // "constructor(public x: boolean) {}" is_typescript_ctor_field: bool = false, + + ts_metadata: TypeScript.Metadata = .m_none, }; }; @@ -1707,7 +1714,7 @@ pub const E = struct { if (comptime !Environment.isWasm) { if (value == @trunc(value) and (value < std.math.maxInt(i32) and value > std.math.minInt(i32))) { const int_value = @as(i64, @intFromFloat(value)); - const abs = @as(u64, @intCast(std.math.absInt(int_value) catch return null)); + const abs = @as(u64, @intCast(@abs(int_value))); if (abs < double_digit.len) { return if (int_value < 0) neg_double_digit[abs] @@ -5987,6 +5994,7 @@ pub const Ast = struct { /// This is a list of named exports that may exist in a CommonJS module /// We use this with `commonjs_at_runtime` to re-export CommonJS commonjs_export_names: []string = &([_]string{}), + import_meta_ref: Ref = Ref.None, pub const CommonJSNamedExport = struct { loc_ref: LocRef, |