зеркало из https://github.com/mozilla/gecko-dev.git
Bug 855036 - Don't treat a string as an object. r=gwagner
--HG-- extra : rebase_source : 98e7ed9d1252847ece46548882d5654f6492ee19
This commit is contained in:
Родитель
798f3a1a55
Коммит
e9235ac9fe
|
@ -673,9 +673,10 @@ GonkGPSGeolocationProvider::Handle(const nsAString& aName,
|
|||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||
NS_ENSURE_TRUE(cx, NS_OK);
|
||||
JSAutoRequest ar(cx);
|
||||
JSAutoCompartment ac(cx, JSVAL_TO_OBJECT(aResult));
|
||||
|
||||
// When we get the APN, we attempt to call data_call_open of AGPS.
|
||||
if (aResult.isString()) {
|
||||
// NB: No need to enter a compartment to read the contents of a string.
|
||||
nsDependentJSString apn;
|
||||
apn.init(cx, aResult.toString());
|
||||
if (!apn.IsEmpty()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче