auto iter = initTable.find(String::fromLatin1(name));
if (iter == initTable.end())
return;
numberOfInitsFound++;
initMethod = selector;
initProtocol = (__bridge Protocol *)iter->value;
types = method_getTypeEncoding(method);
});
if (!numberOfInitsFound)
continue;
if (numberOfInitsFound > 1) {
NSLog(@"ERROR: Class %@ exported more than one init family method via JSExport. Class %@ will not have a callable JavaScript constructor function.", cls, cls);
// This general approach to wrapper caching is pretty effective, but there are a couple of problems:
// (1) For immortal objects JSValues will effectively leak and this results in error output being logged - we should avoid adding associated objects to immortal objects.
// (2) A long lived object may rack up many JSValues. When the contexts are released these will unprotect the associated JavaScript objects,
// but still, would probably nicer if we made it so that only one associated object was required, broadcasting object dealloc.