Commit 772b7730 authored by darin@apple.com's avatar darin@apple.com

2008-06-11 Darin Adler <darin@apple.com>

        Reviewed by Alexey.

        - fix https://bugs.webkit.org/show_bug.cgi?id=19442
          JavaScript array implementation doesn't maintain m_numValuesInVector when sorting

        * kjs/array_instance.cpp:
        (KJS::ArrayInstance::checkConsistency): Added. Empty inline version for when
        consistency checks are turned off.
        (KJS::ArrayInstance::ArrayInstance): Check consistency after construction.
        (KJS::ArrayInstance::~ArrayInstance): Check consistency before destruction.
        (KJS::ArrayInstance::put): Check consistency before and after.
        (KJS::ArrayInstance::deleteProperty): Ditto.
        (KJS::ArrayInstance::setLength): Ditto.
        (KJS::compareByStringPairForQSort): Use typedef for clarity.
        (KJS::ArrayInstance::sort): Check consistency before and after. Also broke the loop
        to set up sorting into two separate passes. Added FIXMEs about various exception
        safety issues. Added code to set m_numValuesInVector after sorting.
        (KJS::ArrayInstance::compactForSorting): Ditto.

        * kjs/array_instance.h: Added a definition of an enum for the types of consistency
        check and a declaration of the consistency checking function.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 312e5395
2008-06-11 Darin Adler <darin@apple.com>
Reviewed by Alexey.
- fix https://bugs.webkit.org/show_bug.cgi?id=19442
JavaScript array implementation doesn't maintain m_numValuesInVector when sorting
* kjs/array_instance.cpp:
(KJS::ArrayInstance::checkConsistency): Added. Empty inline version for when
consistency checks are turned off.
(KJS::ArrayInstance::ArrayInstance): Check consistency after construction.
(KJS::ArrayInstance::~ArrayInstance): Check consistency before destruction.
(KJS::ArrayInstance::put): Check consistency before and after.
(KJS::ArrayInstance::deleteProperty): Ditto.
(KJS::ArrayInstance::setLength): Ditto.
(KJS::compareByStringPairForQSort): Use typedef for clarity.
(KJS::ArrayInstance::sort): Check consistency before and after. Also broke the loop
to set up sorting into two separate passes. Added FIXMEs about various exception
safety issues. Added code to set m_numValuesInVector after sorting.
(KJS::ArrayInstance::compactForSorting): Ditto.
* kjs/array_instance.h: Added a definition of an enum for the types of consistency
check and a declaration of the consistency checking function.
2008-06-10 Kevin Ollivier <kevino@theolliviers.com>
wx build fix. Link against libedit on Mac since HAVE(READLINE) is defined there.
......
This diff is collapsed.
// -*- c-basic-offset: 2 -*-
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2003, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -64,7 +64,10 @@ namespace KJS {
void setLength(unsigned);
bool increaseVectorLength(unsigned newLength);
unsigned compactForSorting();
unsigned compactForSorting();
enum ConsistencyCheckType { NormalConsistencyCheck, DestructorConsistencyCheck, SortConsistencyCheck };
void checkConsistency(ConsistencyCheckType = NormalConsistencyCheck);
unsigned m_length;
unsigned m_vectorLength;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment