in fansh you'll (interestingly enough) get 123 but not null as expected. Similar thing goes for some other List methods which use conversion to int.
Not that I triggered any of this from production code. I still think it needs to be tracked.
brianMon 4 Apr 2011
I fixed List.getSafe because that is sort of an odd case where I think underflow should be handled. But in most cases I don't think it is worth trying to check for overflow/underflow. In Java virtually everything is 32-bit and we do that conversion all over the place - it would be really expensive to add checks everywhere. Plus we have Int in JS as really a 64-bit float, so that is another twist.
vkuzkokovMon 4 Apr 2011
The crazy thing is that in some places there already are checks after conversion.
vkuzkokov Thu 31 Mar 2011
If you type
in fansh you'll (interestingly enough) get
123
but notnull
as expected. Similar thing goes for some otherList
methods which use conversion toint
.Not that I triggered any of this from production code. I still think it needs to be tracked.
brian Mon 4 Apr 2011
I fixed List.getSafe because that is sort of an odd case where I think underflow should be handled. But in most cases I don't think it is worth trying to check for overflow/underflow. In Java virtually everything is 32-bit and we do that conversion all over the place - it would be really expensive to add checks everywhere. Plus we have Int in JS as really a 64-bit float, so that is another twist.
vkuzkokov Mon 4 Apr 2011
The crazy thing is that in some places there already are checks after conversion.