Javascript function
function tile(u,v, a,b,c,d) {
var c0 = tileCorners[a].eval(u,v);
var c1 = tileCorners[b].eval(u-1,v);
var c2 = tileCorners[c].eval(u,v-1);
var c3 = tileCorners[d].eval(u-1,v-1);
return c0 + c1 + c2 + c3;
}
should be equivalent
function tile(u,v, a,b,c,d) {
return
tileCorners[a].eval(u,v) +
tileCorners[b].eval(u-1,v) +
tileCorners[c].eval(u,v-1) +
tileCorners[d].eval(u-1,v-1);
}
but the second function always returns undefined(the debugger will not "enter" calls eval), while the first function behaves correctly. Is there something that several method calls evalare called in the wrong expression?
source
share