Bug 20753
Summary: | JSValueToStringCopy is DLL exported in WebKit.dll on Windows, but you can't get at its data | ||
---|---|---|---|
Product: | WebKit | Reporter: | Matt <matty.hall> |
Component: | Platform | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WORKSFORME | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Windows Vista |
Matt
WebKit.dll exposes a bunch of methods via DLL exports on Windows. One such method is defined as follows:
JSStringRef JSValueToStringCopy(
JSContextRef ctx,
JSValueRef value,
JSValueRef *exception);
Unfortunately, there's no way to get data out of this type without compiling against WebKit's headers to pickup the definition for JSStringRef. This differs from the following exported methods, which actually return a "native" type that one can use without requiring you to compile against WebKit:
bool JSValueToBoolean(
JSContextRef ctx,
JSValueRef value);
double JSValueToNumber(
JSContextRef ctx,
JSValueRef value,
JSValueRef *exception);
It would be really nice if a similar method existed to actually get the string data out of the JSStringRef type:
wchar_t* JSStringRefToCharsCopy(JSStringRef str);
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
> It would be really nice if a similar method existed to actually get the string
> data out of the JSStringRef type:
Such as JSStringCopyBSTR (<http://trac.webkit.org/browser/trunk/JavaScriptCore/API/JSStringRefBSTR.h>) or JSStringGetCharactersPtr (<http://trac.webkit.org/browser/trunk/JavaScriptCore/API/JSStringRef.h#L95>)?
Matt
Sorry -- copy/paste mistake on my part when viewing the DLL exports. These functions do indeed already exist. Thanks guys!