From c46a46e0fa17727f3e79e9236a488c5f6db1013b Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Mon, 24 Mar 2014 08:50:10 -0400 Subject: [PATCH] Bug 845478 - Part 7: Use JS::CallArgs instead of JS_ARGV, `argc` in ipc/{ril,nfc}/. r=vicamo --- ipc/nfc/Nfc.cpp | 7 ++++--- ipc/ril/Ril.cpp | 11 +++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ipc/nfc/Nfc.cpp b/ipc/nfc/Nfc.cpp index 37ec894002e..cc6189f6d45 100644 --- a/ipc/nfc/Nfc.cpp +++ b/ipc/nfc/Nfc.cpp @@ -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; diff --git a/ipc/ril/Ril.cpp b/ipc/ril/Ril.cpp index 52c9663a502..84f9b16ad7a 100644 --- a/ipc/ril/Ril.cpp +++ b/ipc/ril/Ril.cpp @@ -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;