GJS returns pointers instead of numbers for function with output parameters
System information
What is your operating system and version? (e.g. "Linux, Fedora 29" or "macOS 10.13")
arch rolling
4ab70efb")
What is your version of GJS? (e.g. "1.54.1-fc29.1" or "commitgjs 1.77.90
If the bug is related to GNOME Shell, what is your version of GNOME Shell? (e.g. "3.30.1-2ubuntu1" or "commit b405ed64")
not related to shell
Bug information
Steps to reproduce
- Run the following JS code in GJS (you'll need GTK v4.12+)
import Gtk from "gi://Gtk?version=4.0";
const n = new Gtk.NoSelection();
console.log(n.get_section(0));
Current behaviour
GJS prints some random numbers. I believe these numbers are pointers because they are different every time.
$ gjs -m demo.js
Gjs-Console-Message: 22:10:30.245: [
3754760336,
3754760368
]
$ gjs -m demo.js
Gjs-Console-Message: 22:12:13.753: [
1962474240,
1962474272
]
What happened that made it evident there was a problem?
By default, the logged answer should be something like [0, 4294967295]
(the latter number is G_MAXUINT
) as specified by Gtk.SectionModel.get_section
Expected behaviour
What did you expect to see instead?
Correct behavior. the following python code does the exact same thing and works correctly.
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk
n = Gtk.NoSelection()
print(n.get_section(0))
$ python3 demo.py
(out_start=0, out_end=4294967295)
Sorry for the bad title. It may not accurately describe the issue and may need updating