More Box2D fun

Yet more experiements with box2d, this time with a moving platform.

Clicking or tapping on the frame should make the little red cube jump around.

Unfortunately this code relies on a pretty severe emscripten hack to access the raw pointer data for elements.

function step() {
    var body =;
    while(body.a != 0) { // <--------------- This hack
        body = body.GetNext();

I live in hope that one day someone clever will come along and answer this stackoverflow question about it, and explain to me how you're supposed to test for null pointer values in emscripten code.