On 2009/07/29 19:51:28, MikeSamuel wrote:
http://codereview.appspot.com/98051/diff/9/10
File src/com/google/caja/plugin/domita.js (right):
http://codereview.appspot.com/98051/diff/9/10#newcode2590
Line 2590: index <= this.node___.cells.length) {
There's a bit of duplication of code now.
How about creating a guard like
function requireIntIn(idx, min, max) {
if (idx !== (idx | 0) || idx < min || idx > max) {
throw new Error(INDEX_SIZE_ERROR);
}
}
?
Good idea. Done.
http://codereview.appspot.com/98051