readPixels returning undefined

Both:

var pixel = gl.readPixels(1,1,1,1,gl.RGBA,gl.UNSIGNED_BYTE);

and:

var pixel;
gl.readPixels(1,1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, pixel);

evaluate pixel to “undefined”

I am trying to implement color-based picking. This occurs on both Webkit Nightly and Chrome.

Anyone got any information on this? Or if I need to use it differently?

pixel needs to be an allocated array-object:

var pixel = new Uint8Array(4);

that should work