Changeset 798 in webkit for trunk/JavaScriptCore/kjs/number_object.h
- Timestamp:
- Mar 21, 2002, 4:31:57 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/number_object.h
r6 r798 1 // -*- c-basic-offset: 2 -*- 1 2 /* 2 3 * This file is part of the KDE libraries … … 16 17 * License along with this library; if not, write to the Free Software 17 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * 20 * $Id$ 18 21 */ 19 22 … … 21 24 #define _NUMBER_OBJECT_H_ 22 25 23 #include " object.h"24 #include "function .h"26 #include "internal.h" 27 #include "function_object.h" 25 28 26 29 namespace KJS { 27 30 28 class Number Object : public ConstructorImp {31 class NumberInstanceImp : public ObjectImp { 29 32 public: 30 NumberObject(const Object& funcProto, const Object &numProto); 31 virtual KJSO get(const UString &p) const; 33 NumberInstanceImp(const Object &proto); 34 35 virtual const ClassInfo *classInfo() const { return &info; } 36 static const ClassInfo info; 37 }; 38 39 /** 40 * @internal 41 * 42 * The initial value of Number.prototype (and thus all objects created 43 * with the Number constructor 44 */ 45 class NumberPrototypeImp : public NumberInstanceImp { 46 public: 47 NumberPrototypeImp(ExecState *exec, 48 ObjectPrototypeImp *objProto, 49 FunctionPrototypeImp *funcProto); 50 }; 51 52 /** 53 * @internal 54 * 55 * Class to implement all methods that are properties of the 56 * Number.prototype object 57 */ 58 class NumberProtoFuncImp : public InternalFunctionImp { 59 public: 60 NumberProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, 61 int i, int len); 62 63 virtual bool implementsCall() const; 64 virtual Value call(ExecState *exec, Object &thisObj, const List &args); 65 66 enum { ToString, ToLocaleString, ValueOf }; 67 private: 68 int id; 69 }; 70 71 /** 72 * @internal 73 * 74 * The initial value of the the global variable's "Number" property 75 */ 76 class NumberObjectImp : public InternalFunctionImp { 77 public: 78 NumberObjectImp(ExecState *exec, 79 FunctionPrototypeImp *funcProto, 80 NumberPrototypeImp *numberProto); 81 82 virtual bool implementsConstruct() const; 83 virtual Object construct(ExecState *exec, const List &args); 84 85 virtual bool implementsCall() const; 86 virtual Value call(ExecState *exec, Object &thisObj, const List &args); 87 88 Value get(ExecState *exec, const UString &p) const; 89 Value getValueProperty(ExecState *exec, int token) const; 90 virtual const ClassInfo *classInfo() const { return &info; } 91 static const ClassInfo info; 92 enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue }; 93 32 94 Completion execute(const List &); 33 95 Object construct(const List &); 34 };35 36 class NumberPrototype : public ObjectImp {37 public:38 NumberPrototype(const Object& proto);39 virtual KJSO get(const UString &p) const;40 96 }; 41 97
Note:
See TracChangeset
for help on using the changeset viewer.