()
| 205 | testBadIndex_charAt(); |
| 206 | |
| 207 | function testBadIndex_charCodeAt() { |
| 208 | var index = 1; |
| 209 | var hasCaught = false; |
| 210 | var numCalls = 0; |
| 211 | var result; |
| 212 | try { |
| 213 | for (var i = 0; i < 20; i++) { |
| 214 | if (i == 10) index = badIndex; |
| 215 | result = o.charCodeAt(index); |
| 216 | numCalls++; |
| 217 | } |
| 218 | } catch (e) { |
| 219 | hasCaught = true; |
| 220 | } |
| 221 | assertTrue(hasCaught); |
| 222 | assertEquals(49, result); |
| 223 | assertEquals(10, numCalls); |
| 224 | } |
| 225 | testBadIndex_charCodeAt(); |
| 226 | |
| 227 | function testPrototypeChange_charAt() { |
no test coverage detected