| 35 | } |
| 36 | |
| 37 | void start() { |
| 38 | instance = this; |
| 39 | |
| 40 | EM_ASM({ |
| 41 | var initial = stackSave(); |
| 42 | out('seeing initial stack of ' + initial); |
| 43 | setTimeout(function() { |
| 44 | var current = stackSave(); |
| 45 | out('seeing later stack of ' + current); |
| 46 | assert(current === initial); |
| 47 | }, 0); |
| 48 | }); |
| 49 | |
| 50 | // important if we simulate an infinite loop here or not. With an infinite loop, the |
| 51 | // destructor should *NOT* have been called |
| 52 | emscripten_set_main_loop(Class::callback, 3, 1); |
| 53 | } |
| 54 | }; |
| 55 | |
| 56 | Class *Class::instance = NULL; |