change JavaScriptEngine to LoopBasedJavaScriptEngine
Everything works like Node.js. loop() will not need be called explicitly any more. Including some changes: * Every thread of script has a looper. * Use a servant thread in gestures functions of GlobalActionAutomator and image available listener of ScreenCapture. * For keeping events key and touch listener alive, add Loopers.waitWhenIdle to control whether or not Looper should quit when it has nothing to do
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
|
||||
__runtime__.init();
|
||||
|
||||
if(__engine_name__ == "rhino"){
|
||||
__importClass__ = importClass;
|
||||
var importClass = function(pack){
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
module.exports = function(__runtime__, scope){
|
||||
var timers = Object.create(__runtime__.timers);
|
||||
|
||||
scope.__asGlobal__(timers, ['loop', 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'setImmediate', 'clearImmediate']);
|
||||
scope.__asGlobal__(timers, ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'setImmediate', 'clearImmediate']);
|
||||
|
||||
scope.loop = function(){
|
||||
console.warn("loop() has been deprecated and has no effect. Remove it from your code.");
|
||||
}
|
||||
|
||||
return timers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user