(JSFunction func)
| 227 | } |
| 228 | |
| 229 | private Timeout createTimeout(JSFunction func) { |
| 230 | if (func == null || destroyed) return null; |
| 231 | Timeout timeout = new Timeout(timerId.incrementAndGet(), func); |
| 232 | timers.put(timeout.id, timeout); |
| 233 | func.hold(); |
| 234 | return timeout; |
| 235 | } |
| 236 | |
| 237 | private boolean schedule(Timeout timeout, Integer delay) { |
| 238 | try { |