0

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();

});

Edited by techyworld

1
Contributor
1
Reply
20
Views
4 Years
Discussion Span
Last Post by techyworld
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.