mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-16 04:37:41 +00:00
Install an LMLayerWorker when in a Worker scope.
This commit is contained in:
parent
6c5ea6fea9
commit
d1f8d71026
2 changed files with 3 additions and 1 deletions
|
|
@ -17,7 +17,6 @@ describe('LMLayerWorker', function () {
|
|||
assert.isString(code);
|
||||
|
||||
let blob = new Blob([code], { type: 'text/javascript' });
|
||||
debugger;
|
||||
let uri = URL.createObjectURL(blob);
|
||||
|
||||
let worker = new Worker(uri);
|
||||
|
|
|
|||
|
|
@ -205,6 +205,9 @@ class LMLayerWorker {
|
|||
// Let LMLayerWorker be available both in browser and in Node.
|
||||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
||||
module.exports = LMLayerWorker;
|
||||
} else if (typeof self !== 'undefined' && 'postMessage' in self) {
|
||||
// Automatically install if we're in a Web Worker.
|
||||
LMLayerWorker.install(self as DedicatedWorkerGlobalScope);
|
||||
} else {
|
||||
//@ts-ignore
|
||||
window.LMLayerWorker = LMLayerWorker;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue