typescript - web worker postMessage() throws exceptions on functions in class - sometimes -


UPDATED:

I have type-script classes in which they have functions and I want to call those sections of postsmessage I can pass by using OK. But the lower class which functions with a variable fails.

The calling code below is doitSuccess () succeeds. Calling Dotfell () can not perform a "serial" exception, I have successfully passed such objects which are typewrite classes that have function in class.

Update:

  function defaultToString (item: any): string {return "dave"; } Exporting class workers to {Private employee: worker; Producer () {worker = new employee ("my-worker.js"); } Public doitFails (): Zero {var ll = {name: "Dave", toStr: defaultToString}; This.worker.postMessage (LL); } Public doitSuccesss (): zero {var ll = {name: "Dave"}; This.worker.postMessage (LL); }}    

probably incorrect this fix:

  function defaultToString (item: any): string {return "dave"; } Exporting class workers to {Private employee: worker; Public doit = ​​() = & gt; {// fix var ll = {name: "dave", toStr: defaultToString}; This.worker.postMessage (LL); }}   

PS: This video at

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -