After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702365 - gjs: No way to copy Typelib
gjs: No way to copy Typelib
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
: 729386 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-06-15 20:45 UTC by Derek Dai
Modified: 2018-01-27 11:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Derek Dai 2013-06-15 20:45:29 UTC
I tried to load type information in gjs, here is my code snippet
const Gir = imports.gi.GIRepository;
var repo = Gir.Repository.get_default();
repo.require("Gtk", "3.0", 0);

gjs reports
    JS ERROR: !!!   Exception was: Error: Can't create a Javascript object for Typelib; no way to copy
    JS ERROR: !!!     message = '"Can't create a Javascript object for Typelib; no way to copy"'
    JS ERROR: !!!     fileName = '"gi-query.js"'
    JS ERROR: !!!     lineNumber = '3'
    JS ERROR: !!!     stack = '"@gi-query.js:3
"'
Exception was set even though JS_EvaluateScript() returned true - did you gjs_throw() but not return false somewhere perhaps?

I also tried in python, no problem reported
>>> from gi.repository import GIRepository
>>> repo = GIRepository.Repository.get_default()
>>> typelib = repo.require("Gtk", "3.0", 0)
>>> typelib.get_namespace()
'Gtk'
Comment 1 Philip Chimento 2016-11-17 08:05:29 UTC
*** Bug 729386 has been marked as a duplicate of this bug. ***
Comment 2 GNOME Infrastructure Team 2018-01-27 11:53:55 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gjs/issues/73.