Changeset 12728 in webkit for trunk/JavaScriptCore/kjs/internal.h
- Timestamp:
- Feb 9, 2006, 10:42:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/internal.h
r12593 r12728 26 26 #define INTERNAL_H 27 27 28 #include "ustring.h" 28 #include "JSType.h" 29 #include "interpreter.h" 29 30 #include "object.h" 30 31 #include "protect.h" 32 #include "scope_chain.h" 31 33 #include "types.h" 32 #include " interpreter.h"33 #include "scope_chain.h" 34 #include "ustring.h" 35 34 36 #include <kxmlcore/Noncopyable.h> 35 37 #include <kxmlcore/RefPtr.h> … … 50 52 // --------------------------------------------------------------------------- 51 53 52 class UndefinedImp : public JSCell { 53 public: 54 Type type() const { return UndefinedType; } 55 56 JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const; 54 class StringImp : public JSCell { 55 public: 56 StringImp(const UString& v) : val(v) { } 57 UString value() const { return val; } 58 59 JSType type() const { return StringType; } 60 61 JSValue *toPrimitive(ExecState *exec, JSType preferred = UnspecifiedType) const; 57 62 bool toBoolean(ExecState *exec) const; 58 63 double toNumber(ExecState *exec) const; 59 64 UString toString(ExecState *exec) const; 60 65 JSObject *toObject(ExecState *exec) const; 61 };62 63 class NullImp : public JSCell {64 public:65 Type type() const { return NullType; }66 67 JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;68 bool toBoolean(ExecState *exec) const;69 double toNumber(ExecState *exec) const;70 UString toString(ExecState *exec) const;71 JSObject *toObject(ExecState *exec) const;72 };73 74 class BooleanImp : public JSCell {75 public:76 BooleanImp(bool v = false) : val(v) { }77 bool value() const { return val; }78 79 Type type() const { return BooleanType; }80 81 JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;82 bool toBoolean(ExecState *exec) const;83 double toNumber(ExecState *exec) const;84 UString toString(ExecState *exec) const;85 JSObject *toObject(ExecState *exec) const;86 87 private:88 bool val;89 };90 91 class StringImp : public JSCell {92 public:93 StringImp(const UString& v) : val(v) { }94 UString value() const { return val; }95 96 Type type() const { return StringType; }97 98 JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;99 bool toBoolean(ExecState *exec) const;100 double toNumber(ExecState *exec) const;101 UString toString(ExecState *exec) const;102 JSObject *toObject(ExecState *exec) const;103 66 104 67 private: … … 109 72 friend class ConstantValues; 110 73 friend class InterpreterImp; 111 friend JSValue *jsNumber (double);74 friend JSValue *jsNumberCell(double); 112 75 public: 113 76 double value() const { return val; } 114 77 115 Type type() const { return NumberType; }116 117 JSValue *toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;78 JSType type() const { return NumberType; } 79 80 JSValue *toPrimitive(ExecState *exec, JSType preferred = UnspecifiedType) const; 118 81 bool toBoolean(ExecState *exec) const; 119 82 double toNumber(ExecState *exec) const;
Note:
See TracChangeset
for help on using the changeset viewer.