Sign in
webkit
/
WebKit
/
4a12667b4cecb17e84375f8db50c9b2d39b06fe4
/
.
/
JSTests
/
microbenchmarks
/
string-char-code-at.js
blob: c0227fcc9264ac6f09ef705fd3190cce4f13e516 [
file
] [
log
] [
blame
]
function
foo
(
s
)
{
var
result
=
0
;
for
(
var
i
=
0
;
i
<
s
.
length
;
++
i
)
result
+=
s
.
charCodeAt
(
i
);
return
result
;
}
for
(
var
i
=
0
;
i
<
1000000
;
++
i
)
{
var
result
=
foo
(
"hello"
);
if
(
result
!=
532
)
throw
"Error: bad result: "
+
result
;
}