shurcooL/play — pull request #2 by neelance (2014-12-29 01:05:11+00:00)
Title: use int type for indexes

GopherJS emulates a 32-bit architecture, since numbers in JS have a maximum integer precision of 53 bit. So `int` has 32 bits. According to the Go spec: `The length is part of the array's type; it must evaluate to a non-negative constant representable by a value of type int. ` This means that it is valid to only support arrays/slices up to a length of 32 bits. Currently GopherJS does not enforce this, maybe it should. Nevertheless, an `uint64` as an index can still only address elements up to the maximum `int` and using `int` instead yields a better performance.