Anyone can tell me why am having this error?
Uncaught TypeError: Object #<DedicatedWorkerContext> has no method 'terminate' on line 14 below
this.addEventListener("message",function(e){
importScripts('test.js');
var object=e.data;
object=JSON.parse(object);
myArray=object.array;
var tst1=new test();
for (var i=0;i<20;i++ ) {
for (var j=0;j<10;j++) {
word="" + myArray[i][j]+ myArray[i][j+1] + myArray[i][j+2] + myArray[i][j+3] + myArray[i][j+4];
var tst=tst1.accept(word);
if (tst==true){
this.postMessage(tst);
this.terminate();
}
}
}
for (var i=0;i<20;i++ ) {
for (var j=0;j<10;j++) {
word="" + myArray[j][i]+ myArray[j+1][i] + myArray[j+2][i] + myArray[j+3][i] + myArray[j+4][i];
var tst=tst1.accept(word);
if (tst==true){
this.postMessage(tst);
this.terminate();
}
}
}
this.postMessage(false);
this.terminate();
});