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

Function testBadIndex_charCodeAt

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

Source from the content-addressed store, hash-verified

205testBadIndex_charAt();
206
207function 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}
225testBadIndex_charCodeAt();
226
227function testPrototypeChange_charAt() {

Callers 1

string-charat.jsFile · 0.85

Calls 2

assertTrueFunction · 0.70
assertEqualsFunction · 0.50

Tested by

no test coverage detected