21 #ifndef STRING_OBJECT_H_
22 #define STRING_OBJECT_H_
24 #include "function_object.h"
25 #include "JSWrapperObject.h"
31 class StringInstance :
public JSWrapperObject
34 StringInstance(JSObject *proto);
35 StringInstance(JSObject *proto, StringImp *);
36 StringInstance(JSObject *proto,
const UString &);
38 bool getOwnPropertySlot(ExecState *,
const Identifier &, PropertySlot &)
override;
39 bool getOwnPropertySlot(ExecState *,
unsigned propertyName, PropertySlot &)
override;
42 void put(ExecState *exec,
const Identifier &propertyName, JSValue *,
int attr = None)
override;
43 using KJS::JSObject::deleteProperty;
44 bool deleteProperty(ExecState *exec,
const Identifier &propertyName)
override;
45 void getOwnPropertyNames(ExecState *, PropertyNameArray &, PropertyMap::PropertyMode mode)
override;
46 bool getOwnPropertyDescriptor(ExecState *,
const Identifier &, PropertyDescriptor &)
override;
48 UString toString(ExecState *exec)
const override;
49 JSObject *valueClone(Interpreter *targetCtx)
const override;
51 const ClassInfo *classInfo()
const override
55 static const ClassInfo info;
57 StringImp *internalValue()
const
62 bool conversionsCustomized()
const
64 return m_conversionsCustomized;
67 bool inlineGetOwnPropertySlot(ExecState *,
unsigned, PropertySlot &);
69 static JSValue *lengthGetter(ExecState *, JSObject *,
const Identifier &,
const PropertySlot &);
70 static JSValue *indexGetter(ExecState *, JSObject *,
unsigned,
const PropertySlot &);
72 bool m_conversionsCustomized;
86 using KJS::StringInstance::getOwnPropertySlot;
88 const ClassInfo *classInfo()
const override
108 enum { ToString, ValueOf, CharAt, CharCodeAt, Concat, IndexOf, LastIndexOf,
109 Match, Replace, Search, Slice, Split,
110 Substr, Substring, FromCharCode, ToLowerCase, ToUpperCase,
111 ToLocaleLowerCase, ToLocaleUpperCase, Trim, LocaleCompare,
112 StartsWith, EndsWith, Includes,
115 #ifndef KJS_PURE_ECMA
116 , Big, Small, Blink, Bold, Fixed, Italics, Strike, Sub, Sup,
117 Fontcolor, Fontsize, Anchor, Link, TrimLeft, TrimRight
121 static void setToLowerFunction(UnicodeSupport::StringConversionFunction f);
122 static void setToUpperFunction(UnicodeSupport::StringConversionFunction f);
139 bool implementsConstruct()
const override;
140 using KJS::JSObject::construct;
141 JSObject *construct(
ExecState *exec,
const List &args)
override;