GNOME Bugzilla – Bug 732142
add_feature fails in GJS bindings for Session
Last modified: 2014-06-24 14:10:18 UTC
Calling soup_session_add_feature in the GJS binding (session.add_feature) results in an error of 'session.add_feature is not a function'. Upon further investigation, even accessing the method signature in GJS results in an error. I have only tested this in the GJS bindings and I am unaware of any problems in other language bindings. It may be that the add_feature function is conflicting with the add_feature property, though I'm not sure. To reproduce in GJS console: gjs> var session = new Soup.Session(); gjs> session.add_feature; (gjs:7138): libsoup-WARNING **: soup-session.c:866: invalid property id 17 for "add-feature" of type 'GParamObject' in 'SoupSession' gjs> session.add_feature(new Soup.Cache({cache_dir: null, cache_type: 0})); (gjs:7138): libsoup-WARNING **: soup-session.c:866: invalid property id 17 for "add-feature" of type 'GParamObject' in 'SoupSession' TypeError: session.add_feature is not a function A temporary workaround is to pass in the features when constructing the Session object. This is working correctly for me. Example: gjs> var cache = new Soup.Cache({cache_dir: null, cache_type: 0}); gjs> var session = new Soup.Session({"add-feature": cache}); gjs> session.has_feature(cache) true
yeah, known problem, which is considered to be gjs's fault at this point (because the add_feature property is now marked "skip" (bug 655150), so gjs should be ignoring it and seeing only the add_feature method instead). The other workaround is to do: Soup.Session.prototype.add_feature.call(session, feature) instead of session.add_feature(feature) *** This bug has been marked as a duplicate of bug 655189 ***