]> git.saurik.com Git - apple/javascriptcore.git/blob - kjs/array_object.h
JavaScriptCore-466.1.6.tar.gz
[apple/javascriptcore.git] / kjs / array_object.h
1 /*
2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2007 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21 #ifndef ARRAY_OBJECT_H_
22 #define ARRAY_OBJECT_H_
23
24 #include "array_instance.h"
25 #include "function_object.h"
26 #include "lookup.h"
27
28 namespace KJS {
29
30 class ArrayPrototype : public ArrayInstance {
31 public:
32 ArrayPrototype(ExecState*, ObjectPrototype*);
33
34 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
35 virtual const ClassInfo* classInfo() const { return &info; }
36 static const ClassInfo info;
37 };
38
39 class ArrayObjectImp : public InternalFunctionImp {
40 public:
41 ArrayObjectImp(ExecState*, FunctionPrototype*, ArrayPrototype*);
42
43 virtual bool implementsConstruct() const;
44 virtual JSObject* construct(ExecState*, const List&);
45 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
46
47 };
48
49 JSValue* arrayProtoFuncToString(ExecState*, JSObject*, const List&);
50 JSValue* arrayProtoFuncToLocaleString(ExecState*, JSObject*, const List&);
51 JSValue* arrayProtoFuncConcat(ExecState*, JSObject*, const List&);
52 JSValue* arrayProtoFuncJoin(ExecState*, JSObject*, const List&);
53 JSValue* arrayProtoFuncPop(ExecState*, JSObject*, const List&);
54 JSValue* arrayProtoFuncPush(ExecState*, JSObject*, const List&);
55 JSValue* arrayProtoFuncReverse(ExecState*, JSObject*, const List&);
56 JSValue* arrayProtoFuncShift(ExecState*, JSObject*, const List&);
57 JSValue* arrayProtoFuncSlice(ExecState*, JSObject*, const List&);
58 JSValue* arrayProtoFuncSort(ExecState*, JSObject*, const List&);
59 JSValue* arrayProtoFuncSplice(ExecState*, JSObject*, const List&);
60 JSValue* arrayProtoFuncUnShift(ExecState*, JSObject*, const List&);
61 JSValue* arrayProtoFuncEvery(ExecState*, JSObject*, const List&);
62 JSValue* arrayProtoFuncForEach(ExecState*, JSObject*, const List&);
63 JSValue* arrayProtoFuncSome(ExecState*, JSObject*, const List&);
64 JSValue* arrayProtoFuncIndexOf(ExecState*, JSObject*, const List&);
65 JSValue* arrayProtoFuncFilter(ExecState*, JSObject*, const List&);
66 JSValue* arrayProtoFuncMap(ExecState*, JSObject*, const List&);
67 JSValue* arrayProtoFuncLastIndexOf(ExecState*, JSObject*, const List&);
68
69 } // namespace KJS
70
71 #endif // ARRAY_OBJECT_H_