author | Boris Zbarsky <bzbarsky@mit.edu> |
Tue, 31 May 2016 22:00:17 -0400 | |
changeset 338843 | 5ae227cd2b5d1aebb1ca866694b5ba0be242327c |
parent 338842 | b541ce3cbff5099dca2901618f15cfc415396b5b |
child 338844 | 2c74e35ddd1e8a46e04741caa7608ea784369ba1 |
push id | 6249 |
push user | jlund@mozilla.com |
push date | Mon, 01 Aug 2016 13:59:36 +0000 |
treeherder | mozilla-beta@bad9d4f5bf7e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bkelly |
bugs | 1276400 |
milestone | 49.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
dom/base/nsJSUtils.h | file | annotate | diff | comparison | revisions | |
dom/promise/Promise.cpp | file | annotate | diff | comparison | revisions |
--- a/dom/base/nsJSUtils.h +++ b/dom/base/nsJSUtils.h @@ -129,35 +129,16 @@ private: JS::SourceBufferHolder& aSrcBuf, JS::Handle<JSObject*> aEvaluationGlobal, JS::CompileOptions& aCompileOptions, const EvaluateOptions& aEvaluateOptions, JS::MutableHandle<JS::Value> aRetValue, void **aOffThreadToken); }; -class MOZ_STACK_CLASS AutoDontReportUncaught { - JSContext* mContext; - bool mWasSet; - -public: - explicit AutoDontReportUncaught(JSContext* aContext) : mContext(aContext) { - MOZ_ASSERT(aContext); - mWasSet = JS::ContextOptionsRef(mContext).dontReportUncaught(); - if (!mWasSet) { - JS::ContextOptionsRef(mContext).setDontReportUncaught(true); - } - } - ~AutoDontReportUncaught() { - if (!mWasSet) { - JS::ContextOptionsRef(mContext).setDontReportUncaught(false); - } - } -}; - template<typename T> inline bool AssignJSString(JSContext *cx, T &dest, JSString *s) { size_t len = js::GetStringLength(s); static_assert(js::MaxStringLength < (1 << 28), "Shouldn't overflow here or in SetCapacity"); if (MOZ_UNLIKELY(!dest.SetLength(len, mozilla::fallible))) {
--- a/dom/promise/Promise.cpp +++ b/dom/promise/Promise.cpp @@ -2618,17 +2618,17 @@ Promise::ResolveInternal(JSContext* aCx, { NS_ASSERT_OWNINGTHREAD(Promise); CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get(); mResolvePending = true; if (aValue.isObject()) { - AutoDontReportUncaught silenceReporting(aCx); + MOZ_ASSERT(JS::ContextOptionsRef(aCx).autoJSAPIOwnsErrorReporting()); JS::Rooted<JSObject*> valueObj(aCx, &aValue.toObject()); // Thenables. JS::Rooted<JS::Value> then(aCx); if (!JS_GetProperty(aCx, valueObj, "then", &then)) { HandleException(aCx); return; }