Jump to content
Sign in to follow this  

Web Workers calling javascript

Recommended Posts

So, we all know that a Web Worker is an additional piece of javaScript running in the background independent of the main javascript

Smart Mobile Studio is suppose to be replacing javascript with smart pascal right?

"It’s key feature is that it completely replaces javascript with object pascal."

So, shouldn't there be a solution without having to call secondary javaScript?

e.g. instead of calling

FWorker := TWebWorker.Create('worker.js');

shouldn't we be able to just create it

FWorker := TWebWorker.Create;

then override an execute method ? like in Object Pascal ?

here in the execute method should be everything that is in the worker.js (i.e. smart pascal and NOT javascript)

Lately, it seems I am writing lots of javaScript code and it seems to me that SMS should be trying to get away from such a thing.

I do not know how your team can accomplish this, but since you already are translating javascript to smart pascal from js packages/libraries, I image you can thing of a way :)


Share this post

Link to post
Share on other sites

That secondary js that you call is not any hand crafted js. At the moment you can already write it as a separate Smart Mobile Studio WebWorker project.

What I think you are asking here, is to be able to write the code in a normal class or unit, which the compiler would then compile as a WebWorker to a separate js file?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this