diff options
| author | 2022-11-27 22:09:07 -0800 | |
|---|---|---|
| committer | 2022-11-27 22:09:07 -0800 | |
| commit | e5106d320cf3b434b89fe50a51e23955b7edd80e (patch) | |
| tree | cdd30a0f95e2f29c327e23a98deffeba66ca7179 /src | |
| parent | ede2a494bc621496f990954f56e829c8dbe5bb47 (diff) | |
| download | bun-e5106d320cf3b434b89fe50a51e23955b7edd80e.tar.gz bun-e5106d320cf3b434b89fe50a51e23955b7edd80e.tar.zst bun-e5106d320cf3b434b89fe50a51e23955b7edd80e.zip | |
Don't make toJSON enumerable in process.env
Diffstat (limited to 'src')
| -rw-r--r-- | src/bun.js/api/bun.zig | 29 | 
1 files changed, 2 insertions, 27 deletions
| diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index ee26b09f5..b625f552a 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -3301,16 +3301,13 @@ pub const EnvironmentVariables = struct {              .deleteProperty = .{                  .rfn = deleteProperty,              }, -            .convertToType = .{ .rfn = convertToType }, -            .hasProperty = .{ -                .rfn = hasProperty, -            },              .getPropertyNames = .{                  .rfn = getPropertyNames,              },              .toJSON = .{                  .rfn = toJSON,                  .name = "toJSON", +                .enumerable = false,              },          },          .{}, @@ -3443,6 +3440,7 @@ pub const EnvironmentVariables = struct {              entry.value_ptr.* = value_str.slice();          } else { +            defer str.deinit();              // this can be a statically allocated string              if (bun.isHeapMemory(entry.value_ptr.*))                  allocator.free(bun.constStrToU8(entry.value_ptr.*)); @@ -3453,29 +3451,6 @@ pub const EnvironmentVariables = struct {          return true;      } -    pub fn hasProperty( -        globalThis: js.JSContextRef, -        _: js.JSObjectRef, -        propertyName: js.JSStringRef, -    ) callconv(.C) bool { -        var jsc_vm = globalThis.bunVM(); -        const allocator = jsc_vm.allocator; - -        const zig_str = propertyName.toZigString(); -        var str = zig_str.toSlice(allocator); -        defer str.deinit(); -        const name = str.slice(); -        return jsc_vm.bundler.env.map.get(name) != null or (Output.enable_ansi_colors and strings.eqlComptime(name, "FORCE_COLOR")); -    } - -    pub fn convertToType(ctx: js.JSContextRef, obj: js.JSObjectRef, kind: js.JSType, exception: js.ExceptionRef) callconv(.C) js.JSValueRef { -        _ = ctx; -        _ = obj; -        _ = kind; -        _ = exception; -        return obj; -    } -      pub fn getPropertyNames(          _: js.JSContextRef,          _: js.JSObjectRef, | 
