Changeset 19059 in webkit for trunk/JavaScriptCore/API
- Timestamp:
- Jan 23, 2007, 2:23:09 PM (18 years ago)
- Location:
- trunk/JavaScriptCore/API
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSClassRef.cpp
r17649 r19059 38 38 OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* protoClass) 39 39 : refCount(0) 40 // FIXME: <rdar://problem/4949018> 40 41 , className(definition->className) 41 42 , parentClass(definition->parentClass) … … 59 60 staticValues = new StaticValuesTable(); 60 61 while (staticValue->name) { 62 // FIXME: <rdar://problem/4949018> 61 63 staticValues->add(Identifier(staticValue->name).ustring().rep(), 62 64 new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes)); … … 68 70 staticFunctions = new StaticFunctionsTable(); 69 71 while (staticFunction->name) { 72 // FIXME: <rdar://problem/4949018> 70 73 staticFunctions->add(Identifier(staticFunction->name).ustring().rep(), 71 74 new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes)); -
trunk/JavaScriptCore/API/JSContextRef.cpp
r16371 r19059 42 42 JSObject* globalObject; 43 43 if (globalObjectClass) 44 // FIXME: We need to pass a real ExecState here to support an initialize callback in globalObjectClass 45 globalObject = new JSCallbackObject(0, globalObjectClass, 0, 0); 44 globalObject = new JSCallbackObject(0, globalObjectClass, 0, 0); // FIXME: <rdar://problem/4949002> 46 45 else 47 46 globalObject = new JSObject(); -
trunk/JavaScriptCore/API/JSObjectRef.h
r18888 r19059 286 286 */ 287 287 typedef struct { 288 const char* const name; // FIXME: convert UTF8288 const char* const name; 289 289 JSObjectGetPropertyCallback getProperty; 290 290 JSObjectSetPropertyCallback setProperty; … … 300 300 */ 301 301 typedef struct { 302 const char* const name; // FIXME: convert UTF8302 const char* const name; 303 303 JSObjectCallAsFunctionCallback callAsFunction; 304 304 JSPropertyAttributes attributes; -
trunk/JavaScriptCore/API/JSStringRef.cpp
r17372 r19059 47 47 { 48 48 JSLock lock; 49 // FIXME: Only works with ASCII 50 // Use decodeUTF8Sequence or http://www.unicode.org/Public/PROGRAMS/CVTUTF/ instead 49 // FIXME: <rdar://problem/4949018> 51 50 return toRef(UString(string).rep()->ref()); 52 51 } … … 112 111 return result; 113 112 } 114 115 #if defined(__APPLE__)116 JSStringRef JSStringCreateWithCFString(CFStringRef string)117 {118 JSLock lock;119 CFIndex length = CFStringGetLength(string);120 121 // Optimized path for when CFString backing store is a UTF16 buffer122 if (const UniChar* buffer = CFStringGetCharactersPtr(string)) {123 UString::Rep* rep = UString(reinterpret_cast<const UChar*>(buffer), length).rep()->ref();124 return toRef(rep);125 }126 127 UniChar* buffer = static_cast<UniChar*>(fastMalloc(sizeof(UniChar) * length));128 CFStringGetCharacters(string, CFRangeMake(0, length), buffer);129 UString::Rep* rep = UString(reinterpret_cast<UChar*>(buffer), length, false).rep()->ref();130 return toRef(rep);131 }132 133 CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string)134 {135 UString::Rep* rep = toJS(string);136 return CFStringCreateWithCharacters(alloc, reinterpret_cast<const JSChar*>(rep->data()), rep->size());137 }138 139 #endif // __APPLE__ -
trunk/JavaScriptCore/API/JSStringRef.h
r15497 r19059 35 35 #ifdef __cplusplus 36 36 extern "C" { 37 #endif 38 39 #if defined(__APPLE__) 40 #include "JSStringRefCF.h" 37 41 #endif 38 42 … … 137 141 bool JSStringIsEqualToUTF8CString(JSStringRef a, const char* b); 138 142 139 #if defined(__APPLE__)140 #include <CoreFoundation/CoreFoundation.h>141 // CFString convenience methods142 /*!143 @function144 @abstract Creates a JavaScript string from a CFString.145 @discussion This function is optimized to take advantage of cases when146 CFStringGetCharactersPtr returns a valid pointer.147 @param string The CFString to copy into the new JSString.148 @result A JSString containing string. Ownership follows the Create Rule.149 */150 JSStringRef JSStringCreateWithCFString(CFStringRef string);151 /*!152 @function153 @abstract Creates a CFString from a JavaScript string.154 @param alloc The alloc parameter to pass to CFStringCreate.155 @param string The JSString to copy into the new CFString.156 @result A CFString containing string. Ownership follows the Create Rule.157 */158 CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string);159 #endif // __APPLE__160 161 143 #ifdef __cplusplus 162 144 }
Note:
See TracChangeset
for help on using the changeset viewer.