MCPcopy Create free account
hub / github.com/GNOME/gjs / _createClosure

Function _createClosure

modules/core/_common.js:100–111  ·  view source on GitHub ↗
(thisArg, handlerName, swapped, connectObject)

Source from the content-addressed store, hash-verified

98}
99
100function _createClosure(thisArg, handlerName, swapped, connectObject) {
101 connectObject ??= thisArg;
102
103 if (swapped) {
104 throw new Error('Unsupported template signal flag "swapped"');
105 } else if (typeof thisArg[handlerName] === 'undefined') {
106 throw new Error(`A handler called ${handlerName} was not ` +
107 `defined on ${thisArg}`);
108 }
109
110 return thisArg[handlerName].bind(connectObject);
111}
112
113function _createBuilderConnectFunc(klass) {
114 const {GObject} = imports.gi;

Callers 2

vfunc_create_closureMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected