Bug 1279313 part 2. Use an AutoEntryScript when resolving or rejecting a Promise from C++, in case we are resolving with an object and plan to call the "then" getter.

This commit is contained in:
Boris Zbarsky 2016-07-07 20:08:25 -04:00
parent eb139d85bf
commit bcb0a973fb

View File

@ -430,11 +430,8 @@ private:
void MaybeSomething(T& aArgument, MaybeFunc aFunc) {
MOZ_ASSERT(PromiseObj()); // It was preserved!
AutoJSAPI jsapi;
if (!jsapi.Init(mGlobal)) {
return;
}
JSContext* cx = jsapi.cx();
AutoEntryScript aes(mGlobal, "Promise resolution or rejection");
JSContext* cx = aes.cx();
JS::Rooted<JS::Value> val(cx);
if (!ToJSValue(cx, aArgument, &val)) {