rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.66k stars 191 forks source link

clearTimeout undefined #325

Closed trungpham closed 9 years ago

trungpham commented 9 years ago

It seems that clearTimeout and setTimeout functions are not defined. Which makes sense since they are parts of the browser's spec. How do people emulate those functions on the serve side? Thanks.

rainkinz commented 9 years ago

I would be interested in how we could define a BOM using TRR as well. Maybe use envjs or something? In the past I've just defined the functions I need in a Context and used that. For setTimeout I was playing with libuv. This is probably not helpful, but you never know: https://gist.github.com/rainkinz/05873fb5dbd8d1ce5959

cowboyd commented 9 years ago

You need to a callable object named setTimeout into your context.