Changeset 27608 in webkit for trunk/JavaScriptCore/kjs/array_object.h
- Timestamp:
- Nov 8, 2007, 12:31:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/array_object.h
r26881 r27608 3 3 * This file is part of the KDE libraries 4 4 * Copyright (C) 1999-2000 Harri Porten ([email protected]) 5 * Copyright (C) 2007 Apple Inc. All rights reserved. 5 6 * 6 7 * This library is free software; you can redistribute it and/or … … 25 26 #include "array_instance.h" 26 27 #include "function_object.h" 28 #include "lookup.h" 27 29 28 30 namespace KJS { … … 30 32 class ArrayPrototype : public ArrayInstance { 31 33 public: 32 ArrayPrototype(ExecState *exec,33 ObjectPrototype *objProto); 34 bool getOwnPropertySlot(ExecState 35 virtual const ClassInfo *classInfo() const { return &info; }34 ArrayPrototype(ExecState*, ObjectPrototype*); 35 36 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 37 virtual const ClassInfo* classInfo() const { return &info; } 36 38 static const ClassInfo info; 37 };38 39 class ArrayProtoFunc : public InternalFunctionImp {40 public:41 ArrayProtoFunc(ExecState *exec, int i, int len, const Identifier& name);42 43 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);44 45 enum { ToString, ToLocaleString, Concat, Join, Pop, Push,46 Reverse, Shift, Slice, Sort, Splice, UnShift,47 Every, ForEach, Some, IndexOf, Filter, Map, LastIndexOf };48 private:49 int id;50 39 }; 51 40 52 41 class ArrayObjectImp : public InternalFunctionImp { 53 42 public: 54 ArrayObjectImp(ExecState *exec, 55 FunctionPrototype *funcProto, 56 ArrayPrototype *arrayProto); 43 ArrayObjectImp(ExecState*, FunctionPrototype*, ArrayPrototype*); 57 44 58 45 virtual bool implementsConstruct() const; 59 virtual JSObject *construct(ExecState *exec, const List &args);60 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);46 virtual JSObject* construct(ExecState*, const List&); 47 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&); 61 48 62 49 }; 63 50 64 } // namespace 51 #define FOR_EACH_CLASS(macro) \ 52 macro(ArrayProtoFuncToString) \ 53 macro(ArrayProtoFuncToLocaleString) \ 54 macro(ArrayProtoFuncConcat) \ 55 macro(ArrayProtoFuncJoin) \ 56 macro(ArrayProtoFuncPop) \ 57 macro(ArrayProtoFuncPush) \ 58 macro(ArrayProtoFuncReverse) \ 59 macro(ArrayProtoFuncShift) \ 60 macro(ArrayProtoFuncSlice) \ 61 macro(ArrayProtoFuncSort) \ 62 macro(ArrayProtoFuncSplice) \ 63 macro(ArrayProtoFuncUnShift) \ 64 macro(ArrayProtoFuncEvery) \ 65 macro(ArrayProtoFuncForEach) \ 66 macro(ArrayProtoFuncSome) \ 67 macro(ArrayProtoFuncIndexOf) \ 68 macro(ArrayProtoFuncFilter) \ 69 macro(ArrayProtoFuncMap) \ 70 macro(ArrayProtoFuncLastIndexOf) \ 65 71 66 #endif 72 FOR_EACH_CLASS(KJS_IMPLEMENT_PROTOTYPE_FUNCTION_WITH_CREATE) 73 #undef FOR_EACH_CLASS 74 75 } // namespace KJS 76 77 #endif // ARRAY_OBJECT_H_
Note:
See TracChangeset
for help on using the changeset viewer.