summaryrefslogtreecommitdiffstats
path: root/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/CallbackInterfaceHandler.sys.mjs
blob: c062d64e0c499d266bbecf4581b8dca89edaee7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const {{ cbi.handler() }} = new UniFFICallbackHandler(
    "{{ callback_ids.name(ci, cbi) }}",
    {{ callback_ids.get(ci, cbi) }},
    [
        {%- for method in cbi.methods() %}
        new UniFFICallbackMethodHandler(
            "{{ method.nm() }}",
            [
                {%- for arg in method.arguments() %}
                {{ arg.ffi_converter() }},
                {%- endfor %}
            ],
        ),
        {%- endfor %}
    ]
);

// Allow the shutdown-related functionality to be tested in the unit tests
UnitTestObjs.{{ cbi.handler() }} = {{ cbi.handler() }};