File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,23 @@ export function overrides() {
3030 // https://gitlab.gnome.org/GNOME/glib/-/issues/2336
3131 // https://gitlab.gnome.org/GNOME/glib/-/issues/667
3232 GObject . registerClass = function registerWorkbenchClass ( ...args ) {
33- const klass = args [ 0 ] ;
34- const GTypeName = klass . GTypeName || args [ 1 ] ?. name ;
33+ let attrs ;
34+ let klass ;
35+
36+ if ( args . length === 1 ) {
37+ attrs = { } ;
38+ klass = args [ 0 ] ;
39+ } else {
40+ attrs = args [ 0 ] ;
41+ klass = args [ 1 ] ;
42+ }
43+
44+ const GTypeName = attrs . GTypeName || klass . name ;
3545 if ( GTypeName ) {
3646 types [ GTypeName ] = increment ( GTypeName ) ;
37- klass . GTypeName = GTypeName + types [ GTypeName ] ;
47+ attrs . GTypeName = GTypeName + types [ GTypeName ] ;
3848 }
39- return registerClass ( ... args ) ;
49+ return registerClass ( attrs , klass ) ;
4050 } ;
4151 // This is used to tweak `workbench.template` in order to set the
4252 // <template class="?"/> to something that will work next time
You can’t perform that action at this time.
0 commit comments