String array acces
Darin Adler
darin at apple.com
Mon Feb 23 23:00:53 CET 2004
On Feb 21, 2004, at 12:43 PM, Harri Porten wrote:
> I just looked at a diff in string_object.cpp that looks suspicious.
>
> --- string_object.cpp Sat Feb 21 21:34:53 2004
> +++ JavaScriptCore/kjs/string_object.cpp Tue Feb 3 00:03:31 2004
> @@ -60,10 +60,10 @@
> if (ok) {
> const UString s = internalValue().toString(exec);
> const unsigned length = s.size();
> - if (index < length) {
> - const UChar c = s[index];
> - return String(UString(&c, 1));
> - }
> + if (index >= length)
> + return Undefined();
> + const UChar c = s[index];
> + return String(UString(&c, 1));
> }
>
> return ObjectImp::get(exec, propertyName);
The non-JavaScriptCore one looks right to me. The confusion here is
that we didn't change the code; you guys fixed a mistake in it when
rolling into kjs. I already adopted your fixed version in my merge
(still in process).
-- Darin
More information about the Khtml-devel
mailing list