Changeset 29588 in webkit for trunk/JavaScriptCore/kjs/number_object.h
- Timestamp:
- Jan 17, 2008, 11:27:33 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/number_object.h
r28907 r29588 28 28 namespace KJS { 29 29 30 class NumberInstance : public JSWrapperObject {31 public:32 NumberInstance(JSObject *proto);30 class NumberInstance : public JSWrapperObject { 31 public: 32 NumberInstance(JSObject* prototype); 33 33 34 virtual const ClassInfo *classInfo() const { return &info; }35 static const ClassInfo info;36 };34 virtual const ClassInfo* classInfo() const { return &info; } 35 static const ClassInfo info; 36 }; 37 37 38 /** 39 * @internal 40 * 41 * The initial value of Number.prototype (and thus all objects created 42 * with the Number constructor 43 */ 44 class NumberPrototype : public NumberInstance { 45 public: 46 NumberPrototype(ExecState *exec, 47 ObjectPrototype *objProto, 48 FunctionPrototype *funcProto); 49 }; 38 /** 39 * @internal 40 * 41 * The initial value of Number.prototype (and thus all objects created 42 * with the Number constructor 43 */ 44 class NumberPrototype : public NumberInstance { 45 public: 46 NumberPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*); 47 }; 50 48 51 /** 52 * @internal 53 * 54 * Class to implement all methods that are properties of the 55 * Number.prototype object 56 */ 57 class NumberProtoFunc : public InternalFunctionImp { 58 public: 59 NumberProtoFunc(ExecState*, FunctionPrototype*, int i, int len, const Identifier&); 49 /** 50 * @internal 51 * 52 * The initial value of the the global variable's "Number" property 53 */ 54 class NumberObjectImp : public InternalFunctionImp { 55 public: 56 NumberObjectImp(ExecState*, FunctionPrototype*, NumberPrototype*); 60 57 61 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args); 58 virtual bool implementsConstruct() const; 59 virtual JSObject* construct(ExecState*, const List&); 62 60 63 enum { ToString, ToLocaleString, ValueOf, ToFixed, ToExponential, ToPrecision }; 64 private: 65 int id; 66 }; 61 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&); 67 62 68 /** 69 * @internal 70 * 71 * The initial value of the the global variable's "Number" property 72 */ 73 class NumberObjectImp : public InternalFunctionImp { 74 public: 75 NumberObjectImp(ExecState *exec, 76 FunctionPrototype *funcProto, 77 NumberPrototype *numberProto); 63 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 64 JSValue* getValueProperty(ExecState*, int token) const; 78 65 79 virtual bool implementsConstruct() const;80 virtual JSObject *construct(ExecState *exec, const List &args);66 virtual const ClassInfo* classInfo() const { return &info; } 67 static const ClassInfo info; 81 68 82 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);69 enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue }; 83 70 84 bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);85 JSValue *getValueProperty(ExecState *exec, int token) const;71 JSObject* construct(const List&); 72 }; 86 73 87 virtual const ClassInfo *classInfo() const { return &info; } 88 static const ClassInfo info; 89 enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue }; 74 } // namespace KJS 90 75 91 JSObject *construct(const List &); 92 }; 93 94 } // namespace 95 96 #endif 76 #endif // NUMBER_OBJECT_H_
Note:
See TracChangeset
for help on using the changeset viewer.