microsoft / Chakra-Samples

Repository for Chakra JavaScript engine related samples.
MIT License
216 stars 84 forks source link

Set timeout #29

Open Nanonid opened 8 years ago

Nanonid commented 8 years ago

28 Simple example of setTimeout. My pull adds the unfortunate CharkaCore.dll for those who don't build it. This pull also uses .net 3.5, so is more for reference.

liminzhu commented 8 years ago

Thanks @Nanonid! We did have a settimeout implementation in a C++ sample, but one for .NET would certainly be useful and I like the idea of adding a proper .gitignore. @Yongqu would you mind taking a look at this?

Kureev commented 8 years ago

Hello everyone,

I think setTimeout is a bit outside of scope for ChakraCore. It's usually implemented on the browser engine.

What do you think?

liminzhu commented 8 years ago

@Kureev you're absolutely right that setTimeout is a Web API and is outside the scope of JavaScript. It is supplemented by the host (browser, Node, etc) and that's why ChakraCore doesn't support that right out of the box. That said, it's an useful function (another example is console.log) for many hosts, therefore I can see providing an example implementation in the host sample as helpful.