Gio.InputDataStream.read_int32() doesn't return a proper Javascript Number
This is a follow-up to a question I posted on StackOverflow: Writing a native messaging host in GJS.
Here is a short code snippet as an example:
const Lang = imports.lang;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
let loop = new GLib.MainLoop(null, true);
let stdin = new Gio.DataInputStream({
base_stream: new Gio.UnixInputStream({ fd: 0 })
});
let source = stdin.base_stream.create_source(null);
source.set_callback(() => {
log(stdin.read_int32(null));
});
source.attach(null);
loop.run();
And the input/output:
$ gjs --version
gjs 1.50.1
$ gjs int32.js
10
Gjs-Message: JS LOG: 825231882
I've also tested this with Gio.InputDataStream.put_int32()
, but probably *_int64() and so on are also affected.