Reduce the need for Babel polyfills
=== smaller files.
This commit is contained in:
parent
342c46df6f
commit
a53bc7f013
@ -42,7 +42,9 @@ export function WorkerPortal(context, worker, isSlave, serialize) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
data = evt.data;
|
data = evt.data;
|
||||||
}
|
}
|
||||||
const [type, destination, id, params] = data;
|
const destination = data[1];
|
||||||
|
const id = data[2];
|
||||||
|
const params = data[3];
|
||||||
|
|
||||||
function _resolve(value) {
|
function _resolve(value) {
|
||||||
post(1, id, 0, value);
|
post(1, id, 0, value);
|
||||||
@ -52,7 +54,7 @@ export function WorkerPortal(context, worker, isSlave, serialize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we have received an RPC response, satisfy the promise.
|
// If we have received an RPC response, satisfy the promise.
|
||||||
if (type) {
|
if (data[0]) {
|
||||||
if (responseMap.has(id)) {
|
if (responseMap.has(id)) {
|
||||||
const responses = responseMap.get(id);
|
const responses = responseMap.get(id);
|
||||||
responseMap.delete(id);
|
responseMap.delete(id);
|
||||||
@ -121,8 +123,9 @@ export function WorkerPortal(context, worker, isSlave, serialize) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return injectionPointFactory(0, resolveExternalInterfaceFactory)(contextIndex).then(api => ({
|
return injectionPointFactory(0, resolveExternalInterfaceFactory)(contextIndex).then(api =>
|
||||||
...api,
|
Object.assign(api, {
|
||||||
_cleanup: injectionPointFactory(1, resolve => resolve(cleanup()))
|
_cleanup: injectionPointFactory(1, resolve => resolve(cleanup()))
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user