JavaScriptCore: Reverted 2 of the JSValueMakeUndefined replacements because those functions are tied to JSObjectRef instead of JSValueRef. The C compiler will allow this, but C++ will reject the conversion.
It is unclear what the correct handling is for JavaScriptCore. (Nobody bothers to document this in JSCore.) Unlike our other problem where we incorrectly assume JSObjectRef when the functions want JSValueRef, this time Apple is demanding the JSObjectRef. Like our other problem, I assume it is unsafe to try to convert Undefined into a JSObjectRef. So reverting to NULL seems like the safer bet for this specific case. Perhaps the other alternative is to return an exception object or an error object. But I would like to see JSCore document this before trying.
This commit is contained in:
parent
f1c331f2c5
commit
e7b20624cc
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size
|
|||
return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN);
|
||||
goto fail;
|
||||
fail:
|
||||
return JSValueMakeUndefined(context);
|
||||
return NULL;
|
||||
}
|
||||
%}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size
|
|||
|
||||
goto fail;
|
||||
fail:
|
||||
return JSValueMakeUndefined(context);
|
||||
return NULL;
|
||||
}
|
||||
%}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue