Changeset 34861 in webkit for trunk/JavaScriptCore/kjs/StringConstructor.h
- Timestamp:
- Jun 28, 2008, 4:30:55 PM (17 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/StringConstructor.h
r34860 r34861 1 // -*- c-basic-offset: 2 -*-2 1 /* 3 2 * Copyright (C) 1999-2000 Harri Porten ([email protected]) … … 20 19 */ 21 20 22 #ifndef S TRING_OBJECT_H_23 #define S TRING_OBJECT_H_21 #ifndef StringConstructor_h 22 #define StringConstructor_h 24 23 25 #include "JSWrapperObject.h" 26 #include "JSString.h" 27 #include "lookup.h" 24 #include "JSFunction.h" 28 25 29 26 namespace KJS { 30 27 31 28 class FunctionPrototype; 32 33 class StringObject : public JSWrapperObject { 34 public: 35 StringObject(ExecState*, JSObject* prototype); 36 StringObject(ExecState*, JSObject* prototype, const UString&); 37 38 static StringObject* create(ExecState*, JSString*); 39 40 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 41 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 42 43 virtual void put(ExecState* exec, const Identifier& propertyName, JSValue*); 44 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 45 virtual void getPropertyNames(ExecState*, PropertyNameArray&); 46 47 virtual const ClassInfo* classInfo() const { return &info; } 48 static const ClassInfo info; 49 50 JSString* internalValue() const { return static_cast<JSString*>(JSWrapperObject::internalValue());} 51 52 protected: 53 StringObject(JSObject* prototype, JSString*); 54 55 private: 56 virtual UString toString(ExecState*) const; 57 virtual UString toThisString(ExecState*) const; 58 virtual JSString* toThisJSString(ExecState*); 59 }; 60 61 // WebCore uses this to make style.filter undetectable 62 class StringObjectThatMasqueradesAsUndefined : public StringObject { 63 public: 64 StringObjectThatMasqueradesAsUndefined(ExecState* exec, JSObject* proto, const UString& string) 65 : StringObject(exec, proto, string) { } 66 virtual bool masqueradeAsUndefined() const { return true; } 67 virtual bool toBoolean(ExecState*) const { return false; } 68 }; 69 70 /** 71 * @internal 72 * 73 * The initial value of String.prototype (and thus all objects created 74 * with the String constructor 75 */ 76 class StringPrototype : public StringObject { 77 public: 78 StringPrototype(ExecState *exec, 79 ObjectPrototype *objProto); 80 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&); 81 virtual const ClassInfo *classInfo() const { return &info; } 82 static const ClassInfo info; 83 }; 29 class StringPrototype; 84 30 85 31 /** … … 97 43 } // namespace KJS 98 44 99 #endif 45 #endif // StringConstructor_h
Note:
See TracChangeset
for help on using the changeset viewer.