MCPcopy Index your code
hub / github.com/nodejs/node / testBadIndex_charAt

Function testBadIndex_charAt

deps/v8/test/mjsunit/string-charat.js:187–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185};
186
187function testBadIndex_charAt() {
188 var index = 1;
189 var hasCaught = false;
190 var numCalls = 0;
191 var result;
192 try {
193 for (var i = 0; i < 20; i++) {
194 if (i == 10) index = badIndex;
195 result = o.charAt(index);
196 numCalls++;
197 }
198 } catch (e) {
199 hasCaught = true;
200 }
201 assertTrue(hasCaught);
202 assertEquals("1", result);
203 assertEquals(10, numCalls);
204}
205testBadIndex_charAt();
206
207function testBadIndex_charCodeAt() {

Callers 1

string-charat.jsFile · 0.85

Calls 2

assertTrueFunction · 0.70
assertEqualsFunction · 0.50

Tested by

no test coverage detected