mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-08 01:45:32 +00:00
Merge branch 'lmlayer-init' into lmlayer-sans-import-scripts
This commit is contained in:
commit
17dfd2d76e
1 changed files with 14 additions and 2 deletions
|
|
@ -197,8 +197,20 @@ class LMLayerWorker {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance of the LMLayerWorker, and installs
|
||||
* all its functions within the provided Worker scope.
|
||||
* Creates a new instance of the LMLayerWorker, and installs all its
|
||||
* functions within the provided Worker global scope.
|
||||
*
|
||||
* In production, this is called within the Worker's scope as:
|
||||
*
|
||||
* LMLayerWorker.install(self);
|
||||
*
|
||||
* ...and this will setup onmessage and postMessage() appropriately.
|
||||
*
|
||||
* During testing, this method is useful to mock an entire global scope,
|
||||
*
|
||||
* var fakeScope = { postMessage: ... };
|
||||
* LMLayerWorker.install(fakeScope);
|
||||
* // now we can spy on methods in fakeScope!
|
||||
*
|
||||
* @param scope A global scope to install upon.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue