Bug 845478 - Part 7: Use JS::CallArgs instead of JS_ARGV, argc in ipc/{ril,nfc}/. r=vicamo

This commit is contained in:
Birunthan Mohanathas 2014-03-24 08:50:10 -04:00
parent a4b438c948
commit c46a46e0fa
2 changed files with 9 additions and 9 deletions

View File

@ -75,16 +75,17 @@ private:
bool
PostToNFC(JSContext* aCx,
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");
if (aArgc != 1) {
if (args.length() != 1) {
JS_ReportError(aCx, "Expecting one argument with the NFC message");
return false;
}
JS::Value v = JS_ARGV(aCx, aArgv)[0];
JS::Value v = args[0];
JSAutoByteString abs;
void* data;

View File

@ -79,19 +79,18 @@ private:
bool
PostToRIL(JSContext *aCx,
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");
if (aArgc != 2) {
if (args.length() != 2) {
JS_ReportError(aCx, "Expecting two arguments with the RIL message");
return false;
}
JS::Value cv = JS_ARGV(aCx, aArgv)[0];
int clientId = cv.toInt32();
JS::Value v = JS_ARGV(aCx, aArgv)[1];
int clientId = args[0].toInt32();
JS::Value v = args[1];
JSAutoByteString abs;
void *data;