mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 05:12:29 +00:00
FIx macros remap in Transpiler
This commit is contained in:
@@ -443,7 +443,7 @@ fn transformOptionsFromJSC(ctx: JSC.C.JSContextRef, temp_allocator: std.mem.Allo
|
||||
macros: {
|
||||
if (macros.isUndefinedOrNull()) break :macros;
|
||||
const kind = macros.jsType();
|
||||
const is_object = kind == JSC.JSValue.JSType.Object;
|
||||
const is_object = kind.isObject();
|
||||
if (!(kind.isStringLike() or is_object)) {
|
||||
JSC.throwInvalidArguments("macro must be an object", .{}, ctx, exception);
|
||||
return transpiler;
|
||||
|
||||
@@ -1439,6 +1439,13 @@ pub const JSValue = enum(i64) {
|
||||
MaxJS = 0b11111111,
|
||||
_,
|
||||
|
||||
pub fn isObject(this: JSType) bool {
|
||||
return switch (this) {
|
||||
.Object, .FinalObject => true,
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn toC(this: JSType) C_API.JSTypedArrayType {
|
||||
return switch (this) {
|
||||
.Int8Array => .kJSTypedArrayTypeInt8Array,
|
||||
|
||||
Reference in New Issue
Block a user