#nodejs.util.inspect.custom difference

1 messages ยท Page 1 of 1 (latest)

native sierra
#

Using nodejs.util.inspect.custom in this simple nodejs-polars example produces a different result in bun vs. node. Any ๐Ÿ’ก? Thx

import pl from 'nodejs-polars';
console.log(pl.DataFrame([{ a: 1, b: 2,}]));

Node:

shape: (1, 2)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”
โ”‚ a โ”† b โ”‚
โ”‚ --- โ”† --- โ”‚
โ”‚ f64 โ”† f64 โ”‚
โ•žโ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•ก
โ”‚ 1.0 โ”† 2.0 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”˜
Bun:

ProxyObject {
a: shape: (1,)
Series: 'a' [f64]
[
1.0
],
b: shape: (1,)
Series: 'b' [f64]
[
2.0
],
}

tropic dome
#

@flat reef , IIUC, thinks Proxy objects should not be able to override the custom inspector property.

flat reef
#

i agree

#

i think util inspect just literlaly prints the underlying object?

#

if you want i can implement this right now pretty simply

#

oh i see what is happening

#

im going to just fix proxy printing

#

in general

tropic dome
#

to do what, though?

#

or I can just wait and see, pretty sure you're going to get it right ๐Ÿ™‚

flat reef
#

what node does
which is not calling the proxy getters and magically peeking at the internal proxy object

#

also stuff like this

#

we arent handling

tropic dome
#

what about process.env? Is that still a proxy?

flat reef
#

yes but it isnt an issue for this

flat reef
#

oh this doesnt fix it

tropic dome
#

because node inspects the underlying object for a nodejs.util.inspect.custom prop?

flat reef
#

yep