source: webkit/trunk/JavaScriptCore/kjs/JSArray.h@ 34582

Last change on this file since 34582 was 34582, checked in by Darin Adler, 17 years ago

JavaScriptCore:

2008-06-15 Darin Adler <Darin Adler>

  • API/JSCallbackFunction.cpp:
  • API/JSObjectRef.cpp:
  • DerivedSources.make:
  • GNUmakefile.am:
  • JavaScriptCore.exp:
  • JavaScriptCore.pri:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • VM/Machine.cpp:
  • kjs/AllInOneFile.cpp:
  • kjs/ArrayPrototype.cpp: Copied from JavaScriptCore/kjs/array_object.cpp.
  • kjs/ArrayPrototype.h: Copied from JavaScriptCore/kjs/array_object.h.
  • kjs/BooleanObject.cpp: Copied from JavaScriptCore/kjs/bool_object.cpp.
  • kjs/BooleanObject.h: Copied from JavaScriptCore/kjs/bool_object.h.
  • kjs/ExecState.cpp:
  • kjs/ExecState.h:
  • kjs/FunctionPrototype.cpp: Copied from JavaScriptCore/kjs/function_object.cpp.
  • kjs/FunctionPrototype.h: Copied from JavaScriptCore/kjs/function_object.h.
  • kjs/JSArray.cpp: Copied from JavaScriptCore/kjs/array_instance.cpp.
  • kjs/JSArray.h: Copied from JavaScriptCore/kjs/array_instance.h.
  • kjs/JSFunction.cpp:
  • kjs/JSFunction.h:
  • kjs/JSGlobalObject.cpp:
  • kjs/JSImmediate.cpp:
  • kjs/JSObject.h:
  • kjs/JSString.h:
  • kjs/JSValue.h:
  • kjs/JSVariableObject.cpp:
  • kjs/MathObject.cpp: Copied from JavaScriptCore/kjs/math_object.cpp.
  • kjs/MathObject.h: Copied from JavaScriptCore/kjs/math_object.h.
  • kjs/NumberObject.cpp: Copied from JavaScriptCore/kjs/number_object.cpp.
  • kjs/NumberObject.h: Copied from JavaScriptCore/kjs/number_object.h.
  • kjs/PropertyMap.cpp: Copied from JavaScriptCore/kjs/property_map.cpp.
  • kjs/PropertyMap.h: Copied from JavaScriptCore/kjs/property_map.h.
  • kjs/PropertySlot.cpp: Copied from JavaScriptCore/kjs/property_slot.cpp.
  • kjs/PropertySlot.h: Copied from JavaScriptCore/kjs/property_slot.h.
  • kjs/RegExpObject.cpp: Copied from JavaScriptCore/kjs/regexp_object.cpp.
  • kjs/RegExpObject.h: Copied from JavaScriptCore/kjs/regexp_object.h.
  • kjs/ScopeChain.cpp: Copied from JavaScriptCore/kjs/scope_chain.cpp.
  • kjs/ScopeChain.h: Copied from JavaScriptCore/kjs/scope_chain.h.
  • kjs/ScopeChainMark.h: Copied from JavaScriptCore/kjs/scope_chain_mark.h.
  • kjs/Shell.cpp:
  • kjs/array_instance.cpp: Removed.
  • kjs/array_instance.h: Removed.
  • kjs/array_object.cpp: Removed.
  • kjs/array_object.h: Removed.
  • kjs/bool_object.cpp: Removed.
  • kjs/bool_object.h: Removed.
  • kjs/error_object.h:
  • kjs/function_object.cpp: Removed.
  • kjs/function_object.h: Removed.
  • kjs/internal.cpp:
  • kjs/math_object.cpp: Removed.
  • kjs/math_object.h: Removed.
  • kjs/nodes.cpp:
  • kjs/number_object.cpp: Removed.
  • kjs/number_object.h: Removed.
  • kjs/object_object.cpp:
  • kjs/property_map.cpp: Removed.
  • kjs/property_map.h: Removed.
  • kjs/property_slot.cpp: Removed.
  • kjs/property_slot.h: Removed.
  • kjs/regexp_object.cpp: Removed.
  • kjs/regexp_object.h: Removed.
  • kjs/scope_chain.cpp: Removed.
  • kjs/scope_chain.h: Removed.
  • kjs/scope_chain_mark.h: Removed.
  • kjs/string_object.cpp:
  • kjs/string_object.h:

WebCore:

2008-06-15 Darin Adler <Darin Adler>

  • ForwardingHeaders/kjs/ArrayPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/array_object.h.
  • ForwardingHeaders/kjs/BooleanObject.h: Copied from WebCore/ForwardingHeaders/kjs/bool_object.h.
  • ForwardingHeaders/kjs/FunctionPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/function_object.h.
  • ForwardingHeaders/kjs/JSArray.h: Copied from WebCore/ForwardingHeaders/kjs/array_instance.h.
  • ForwardingHeaders/kjs/PropertyMap.h: Copied from WebCore/ForwardingHeaders/kjs/property_map.h.
  • ForwardingHeaders/kjs/array_instance.h: Removed.
  • ForwardingHeaders/kjs/array_object.h: Removed.
  • ForwardingHeaders/kjs/bool_object.h: Removed.
  • ForwardingHeaders/kjs/function_object.h: Removed.
  • ForwardingHeaders/kjs/property_map.h: Removed.
  • WebCore.vcproj/WebCore.vcproj:
  • bindings/js/JSClipboardCustom.cpp:
  • bindings/js/JSDatabaseCustom.cpp:
  • bindings/js/JSJavaScriptCallFrameCustom.cpp:
  • bindings/js/kjs_events.cpp:
  • bridge/jni/jni_utility.cpp:
  • bridge/qt/qt_runtime.cpp:
  • bridge/runtime_array.cpp:

WebKit/mac:

2008-06-15 Darin Adler <Darin Adler>

  • WebView/WebView.mm:

WebKit/qt:

2008-06-15 Darin Adler <Darin Adler>

  • WebKit_pch.h:

WebKitTools:

2008-06-15 Darin Adler <Darin Adler>

  • Scripts/do-file-rename: Updated.
  • Scripts/do-webcore-rename: Updated for the latest round of renaming.
  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * Copyright (C) 1999-2000 Harri Porten ([email protected])
4 * Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#ifndef JSArray_h
23#define JSArray_h
24
25#include "JSObject.h"
26
27namespace KJS {
28
29 struct ArrayStorage;
30
31 class JSArray : public JSObject {
32 public:
33 JSArray(JSObject* prototype, unsigned initialLength);
34 JSArray(JSObject* prototype, const List& initialValues);
35 ~JSArray();
36
37 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
38 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
39 virtual void put(ExecState*, const Identifier& propertyName, JSValue*);
40 virtual void put(ExecState*, unsigned propertyName, JSValue*);
41 virtual bool deleteProperty(ExecState *, const Identifier& propertyName);
42 virtual bool deleteProperty(ExecState *, unsigned propertyName);
43 virtual void getPropertyNames(ExecState*, PropertyNameArray&);
44
45 virtual void mark();
46
47 virtual const ClassInfo* classInfo() const { return &info; }
48 static const ClassInfo info;
49
50 unsigned getLength() const { return m_length; }
51 JSValue* getItem(unsigned) const;
52
53 void sort(ExecState*);
54 void sort(ExecState*, JSObject* compareFunction);
55
56 protected:
57 void* lazyCreationData();
58 void setLazyCreationData(void*);
59
60 private:
61 static JSValue* lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
62 bool inlineGetOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
63
64 void setLength(unsigned);
65 bool increaseVectorLength(unsigned newLength);
66
67 unsigned compactForSorting();
68
69 enum ConsistencyCheckType { NormalConsistencyCheck, DestructorConsistencyCheck, SortConsistencyCheck };
70 void checkConsistency(ConsistencyCheckType = NormalConsistencyCheck);
71
72 unsigned m_length;
73 unsigned m_vectorLength;
74 ArrayStorage* m_storage;
75 };
76
77} // namespace KJS
78
79#endif
Note: See TracBrowser for help on using the repository browser.