MCPcopy
hub / github.com/putyy/res-downloader / exposePublicSymbol

Function exposePublicSymbol

frontend/src/assets/js/decrypt.js:2165–2186  ·  view source on GitHub ↗

@param {number=} numArguments

(name, value, numArguments)

Source from the content-addressed store, hash-verified

2163 }
2164 /** @param {number=} numArguments */
2165 function exposePublicSymbol(name, value, numArguments) {
2166 if (Module.hasOwnProperty(name)) {
2167 if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) {
2168 throwBindingError("Cannot register public name '" + name + "' twice");
2169 }
2170
2171 // We are exposing a function with the same name as an existing function. Create an overload table and a function selector
2172 // that routes between the two.
2173 ensureOverloadTable(Module, name, name);
2174 if (Module.hasOwnProperty(numArguments)) {
2175 throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!");
2176 }
2177 // Add the new function into the overload table.
2178 Module[name].overloadTable[numArguments] = value;
2179 }
2180 else {
2181 Module[name] = value;
2182 if (undefined !== numArguments) {
2183 Module[name].numArguments = numArguments;
2184 }
2185 }
2186 }
2187
2188 /** @constructor */
2189 function RegisteredClass(

Callers 2

__embind_register_classFunction · 0.85

Calls 2

throwBindingErrorFunction · 0.85
ensureOverloadTableFunction · 0.85

Tested by

no test coverage detected