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: probably incorrect PS: This video at
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); }}
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); }}
Comments
Post a Comment