Test cases
Test #1 Title *
Async
Code * for (let i = 0 ; i < 1000 ; ++i) {
let str = `${i} ${i} ` ;
acc1 += str.slice (2 ).search (Regex 1);
}
Test #2 Title *
Async
Code * for (let i = 0 ; i < 1000 ; ++i) {
let str = `${i} ${i} ` ;
let j = 2 ;
let char = str[j];
while ( char >= 'a' && char <= 'z' || char >= 'A' && char <= 'Z' || char >= '0' && char <= '9' || char === '_' )
char = str[++j];
acc2 += j;
}
Title *
Async
Code * for (let i = 0 ; i < 1000 ; ++i) {
let str = `${i} ${i} ` ;
let j = 2 ;
let char = str.codePointAt (j);
while ( char >= 97 && char <= 122 || char >= 65 && char <= 90 || char >= 48 && char <= 57 || char === '_' )
char = str.codePointAt (++j);
acc3 += j;
}
Title *
Async
Code * for (let i = 0 ; i < 1000 ; ++i) {
let str = `${i} ${i} ` ;
let j = 2 ;
let char = str.charCodeAt (j);
while ( char >= 97 && char <= 122 || char >= 65 && char <= 90 || char >= 48 && char <= 57 || char === '_' )
char = str.charCodeAt (++j);
acc4 += j;
}
Title *
Async
Code * for (let i = 0 ; i < 1000 ; ++i) {
let str = `${i} ${i} ` ;
acc5 += str.slice (2 ).search (Regex 2);
}
Title *
Async
Code * for (let i = 0 ; i < 1000 ; ++i) {
let str = `${i} ${i} ` ;
Regex 3.exec (str.slice (2 ));
acc6 += Regex 3.lastIndex ;
}
Title *
Async
Code * for (let i = 0 ; i < 1000 ; ++i) {
let str = `${i} ${i} ` ;
const reg = /^[\w]+/ ;
reg.exec (str.slice (2 ));
acc7 += reg.lastIndex ;
}