mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 845478 - Part 7: Use JS::CallArgs instead of JS_ARGV, argc
in ipc/{ril,nfc}/. r=vicamo
This commit is contained in:
parent
a4b438c948
commit
c46a46e0fa
@ -75,16 +75,17 @@ private:
|
|||||||
bool
|
bool
|
||||||
PostToNFC(JSContext* aCx,
|
PostToNFC(JSContext* aCx,
|
||||||
unsigned aArgc,
|
unsigned aArgc,
|
||||||
JS::Value* aArgv)
|
JS::Value* aVp)
|
||||||
{
|
{
|
||||||
|
JS::CallArgs args = JS::CallArgsFromVp(aArgc, aVp);
|
||||||
NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread");
|
NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread");
|
||||||
|
|
||||||
if (aArgc != 1) {
|
if (args.length() != 1) {
|
||||||
JS_ReportError(aCx, "Expecting one argument with the NFC message");
|
JS_ReportError(aCx, "Expecting one argument with the NFC message");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
JS::Value v = JS_ARGV(aCx, aArgv)[0];
|
JS::Value v = args[0];
|
||||||
|
|
||||||
JSAutoByteString abs;
|
JSAutoByteString abs;
|
||||||
void* data;
|
void* data;
|
||||||
|
@ -79,19 +79,18 @@ private:
|
|||||||
bool
|
bool
|
||||||
PostToRIL(JSContext *aCx,
|
PostToRIL(JSContext *aCx,
|
||||||
unsigned aArgc,
|
unsigned aArgc,
|
||||||
JS::Value *aArgv)
|
JS::Value *aVp)
|
||||||
{
|
{
|
||||||
|
JS::CallArgs args = JS::CallArgsFromVp(aArgc, aVp);
|
||||||
NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread");
|
NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread");
|
||||||
|
|
||||||
if (aArgc != 2) {
|
if (args.length() != 2) {
|
||||||
JS_ReportError(aCx, "Expecting two arguments with the RIL message");
|
JS_ReportError(aCx, "Expecting two arguments with the RIL message");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
JS::Value cv = JS_ARGV(aCx, aArgv)[0];
|
int clientId = args[0].toInt32();
|
||||||
int clientId = cv.toInt32();
|
JS::Value v = args[1];
|
||||||
|
|
||||||
JS::Value v = JS_ARGV(aCx, aArgv)[1];
|
|
||||||
|
|
||||||
JSAutoByteString abs;
|
JSAutoByteString abs;
|
||||||
void *data;
|
void *data;
|
||||||
|
Loading…
Reference in New Issue
Block a user