Changeset 9889 in webkit for trunk/JavaScriptCore/kjs/string_object.cpp
- Timestamp:
- Jul 25, 2005, 3:17:20 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/string_object.cpp
r9768 r9889 51 51 } 52 52 53 Value StringInstanceImp::get(ExecState *exec, const Identifier &propertyName) const 54 { 55 if (propertyName == lengthPropertyName) 56 return Number(internalValue().toString(exec).size()); 53 bool StringInstanceImp::getOwnProperty(ExecState *exec, const Identifier& propertyName, Value& result) const 54 { 55 if (propertyName == lengthPropertyName) { 56 result = Value(internalValue().toString(exec).size()); 57 return true; 58 } 57 59 58 60 bool ok; … … 64 66 return Undefined(); 65 67 const UChar c = s[index]; 66 return String(UString(&c, 1)); 67 } 68 69 return ObjectImp::get(exec, propertyName); 68 result = Value(UString(&c, 1)); 69 return true; 70 } 71 72 return ObjectImp::getOwnProperty(exec, propertyName, result); 70 73 } 71 74 … … 152 155 } 153 156 154 Value StringPrototypeImp::get(ExecState *exec, const Identifier &propertyName) const155 { 156 return lookupGet Function<StringProtoFuncImp, StringInstanceImp>( exec, propertyName, &stringTable, this);157 bool StringPrototypeImp::getOwnProperty(ExecState *exec, const Identifier& propertyName, Value& result) const 158 { 159 return lookupGetOwnFunction<StringProtoFuncImp, StringInstanceImp>(exec, propertyName, &stringTable, this, result); 157 160 } 158 161
Note:
See TracChangeset
for help on using the changeset viewer.