在实机测试没有问题,只在开发者工具中报错,经测macOS端开发者工具也是一样情况。
worker中的代码 :
var test = function(){
console.log(“timeout tick”);
}
setTimeout(test,1000);
开发者工具console信息
VM32:3 Uncaught ReferenceError: Reporter is not defined
at setTimeout (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:10423)
at eval (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:8:1)
at require (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:24484)
at o (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:23372)
at eval (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:13744)
at eval (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:1:3789)
at Array.forEach (<anonymous>)
at Object.h (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:1:3747)
at self.onmessage.event (weixinworker.js:10)