Changeset 35775 in webkit for trunk/JavaScriptCore/API/APICast.h


Ignore:
Timestamp:
Aug 15, 2008, 12:43:48 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.

JSStringRef is created context-free, but can get linked to one via an identifier table,
breaking an implicit API contract.

Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/APICast.h

    r35442 r35775  
    4141typedef const struct OpaqueJSContext* JSContextRef;
    4242typedef struct OpaqueJSContext* JSGlobalContextRef;
    43 typedef struct OpaqueJSString* JSStringRef;
    4443typedef struct OpaqueJSPropertyNameAccumulator* JSPropertyNameAccumulatorRef;
    4544typedef const struct OpaqueJSValue* JSValueRef;
     
    6160{
    6261    return reinterpret_cast<KJS::JSValue*>(const_cast<OpaqueJSValue*>(v));
    63 }
    64 
    65 inline KJS::UString::Rep* toJS(JSStringRef b)
    66 {
    67     return reinterpret_cast<KJS::UString::Rep*>(b);
    6862}
    6963
     
    9185{
    9286    return reinterpret_cast<JSValueRef*>(const_cast<const KJS::JSValue**>(v));
    93 }
    94 
    95 inline JSStringRef toRef(KJS::UString::Rep* s)
    96 {
    97     return reinterpret_cast<JSStringRef>(s);
    9887}
    9988
Note: See TracChangeset for help on using the changeset viewer.