(From update of attachment 421240) OK, but you can vastly simplify the code by using a better regular expression. E.g.:
<script> function offsetToWord(data, offset) { var rest = data.substr(offset); var m = rest.match(/^\w+/); return m ? m : ""; } function test(data, offset) { document.write("offsetToWord(\"" + data + "\"," + offset + ") = \"" + offsetToWord(data, offset) + "\"<br>"); } test("hello kitty", 0); test("hello kitty", 2); test("hello kitty", 5); test("hello kitty", 6); test("hello kitty", 8); </script>
Please revise the patch like that and then we can get this landed.
(From update of attachment 421240)
OK, but you can vastly simplify the code by using a better regular expression. E.g.:
<script> offset) ; write(" offsetToWord( \"" + data + "\"," + offset + ") = \"" + offsetToWord(data, offset) + "\"<br>");
function offsetToWord(data, offset) {
var rest = data.substr(
var m = rest.match(/^\w+/);
return m ? m : "";
}
function test(data, offset) {
document.
}
test("hello kitty", 0);
test("hello kitty", 2);
test("hello kitty", 5);
test("hello kitty", 6);
test("hello kitty", 8);
</script>
Please revise the patch like that and then we can get this landed.