function setExitTimeout(time){
let timeoutExit_ = engines.execScript(util.format("%s 的定时关闭", files.getName(engines.myEngine().source)),
([
"events.on(\"set_e\", (engine, time) => {",
" console.log(engine, time);",
" setTimeout(()=>{",
" engine.forceStop();",
" }, time);",
"});",
"setTimeout(()=>{}, 5000);"
]).join("\n"));
while(timeoutExit_.getEngine() === null){}
setTimeout(()=>{timeoutExit_.getEngine().emit("set_e", engines.myEngine(), time)}, 250);
let engine = timeoutExit_.getEngine();
class timeoutExit {
constructor (engine) {
this.engine = engine;
}
clear () {
this.engine.forceStop();
}
}
return new timeoutExit(engine);
}
setExitTimeout(6000);
// setTimeout(()=>{}, 10000);
22:56:46.858/E: identifier is a reserved word: class (/storage/emulated/0/auto.js/脚本/自动启动脚本/每n分钟执行一次/1/1.js#15)
identifier is a reserved word: class
是为什么啊