Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gjs gjs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 104
    • Issues 104
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gjsgjs
  • Issues
  • #189
Closed
Open
Created Aug 02, 2018 by Philip Chimento@ptomato🚮Maintainer

Object resolve should consider prototypes of GObject interfaces

It's currently not possible to add or monkeypatch methods on a GObject interface:

const {Gio} = imports.gi;
Gio.File.prototype.test = 42;
const file = Gio.File.new_for_path('.');
print(file.test);

This is undefined and not 42. (new_for_path() actually returns you an instance of GLocalFile which is a class that implements the Gio.File interface.)

The resolve hook in object.cpp should, when searching the prototype of a class, also search the prototypes of any implemented interfaces.

/cc @llzes

Assignee
Assign to
Time tracking