Bug 1033138 - Use AutoJSAPI instead of AutJSContext. r=bholley

This commit is contained in:
Chuck Lee 2014-07-03 11:31:52 +08:00
parent ffa960fbea
commit 1c0609c23a

View File

@ -240,9 +240,12 @@ MobileMessageCallback::NotifyGetSegmentInfoForTextFailed(int32_t aError)
NS_IMETHODIMP
MobileMessageCallback::NotifyGetSmscAddress(const nsAString& aSmscAddress)
{
AutoJSContext cx;
JSString* smsc = JS_NewUCStringCopyN(cx,
static_cast<const jschar *>(aSmscAddress.BeginReading()),
AutoJSAPI jsapi;
if (NS_WARN_IF(!jsapi.Init(mDOMRequest->GetOwner()))) {
return NotifyError(nsIMobileMessageCallback::INTERNAL_ERROR);
}
JSContext* cx = jsapi.cx();
JSString* smsc = JS_NewUCStringCopyN(cx, aSmscAddress.BeginReading(),
aSmscAddress.Length());
if (!smsc) {