Don't need fnName here.

This commit is contained in:
Timothy Farrell 2016-12-27 17:00:01 -06:00
parent ee9aeb8c3c
commit a01a9a53b7

View File

@ -82,7 +82,7 @@ export function WorkerPortal(context, worker, serialize) {
} }
} }
function injectionPointFactory(fnId, fnName, callbackFactory) { function injectionPointFactory(fnId, callbackFactory) {
return () => return () =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
const id = callCount; const id = callCount;
@ -96,7 +96,7 @@ export function WorkerPortal(context, worker, serialize) {
return linkedFunctionNames => { return linkedFunctionNames => {
const externalInterface = {}; const externalInterface = {};
linkedFunctionNames.forEach((fnName, index) => { linkedFunctionNames.forEach((fnName, index) => {
externalInterface[fnName] = injectionPointFactory(index, fnName); externalInterface[fnName] = injectionPointFactory(index);
}); });
resolve(externalInterface); resolve(externalInterface);
return contextIndex; return contextIndex;
@ -110,5 +110,5 @@ export function WorkerPortal(context, worker, serialize) {
contextIndex.splice(0, 0, '__init'); contextIndex.splice(0, 0, '__init');
context.__init = resolveExternalInterfaceFactory(resolve); context.__init = resolveExternalInterfaceFactory(resolve);
}) })
: injectionPointFactory(0, '___init___', resolveExternalInterfaceFactory)(contextIndex); : injectionPointFactory(0, resolveExternalInterfaceFactory)(contextIndex);
} }