It looks like asm.js only allows indexing into an Int32Array or Uint32Array using an expression of the form (foo >> 2), though I can't find any reference to this in the spec. That is, it assumes that what you have is an address and are trying to look up the integer at that address. I guess that makes sense, kinda since C code like this:
int32_t arr[5];
arr[i];
would get compiled down to machine code that does the equivalent of *((char*)arr + 4*i)
... Anyway, replacing els[i] = i
in your code with:
els[(i<<2)>>2] = i;
seems to make things work with a Uint32Array.