Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
20 lines
300 B
JavaScript
Executable file
20 lines
300 B
JavaScript
Executable file
'use strict';
|
|
/* exported MockWakeLock */
|
|
|
|
var MyLocks = {};
|
|
|
|
var MockWakeLock = function(type) {
|
|
if (MyLocks[type] === true) {
|
|
throw new Error('Already locked');
|
|
}
|
|
|
|
MyLocks[type] = true;
|
|
|
|
var lock = {
|
|
'unlock': function() {
|
|
MyLocks[type] = false;
|
|
}
|
|
};
|
|
|
|
return lock;
|
|
};
|