mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 02:35:41 +00:00
Bug 1506323 - Add JS::PrintError to public API. r=tcampbell
Depends on D11568 Differential Revision: https://phabricator.services.mozilla.com/D11569 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
dd1c4d38c5
commit
700abccb03
@ -4286,6 +4286,16 @@ CreateError(JSContext* cx, JSExnType type, HandleObject stack,
|
||||
HandleString fileName, uint32_t lineNumber, uint32_t columnNumber,
|
||||
JSErrorReport* report, HandleString message, MutableHandleValue rval);
|
||||
|
||||
/*
|
||||
* Prints a full report and returns true if the given report is non-nullptr
|
||||
* and the report doesn't have the JSREPORT_WARNING flag set or reportWarnings
|
||||
* is true.
|
||||
* Returns false otherwise.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
PrintError(JSContext* cx, FILE* file, ConstUTF8CharsZ toStringResult,
|
||||
JSErrorReport* report, bool reportWarnings);
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -9475,7 +9475,7 @@ js::shell::AutoReportException::~AutoReportException()
|
||||
MOZ_ASSERT(!JSREPORT_IS_WARNING(report.report()->flags));
|
||||
|
||||
FILE* fp = ErrorFilePointer();
|
||||
PrintError(cx, fp, report.toStringResult(), report.report(), reportWarnings);
|
||||
JS::PrintError(cx, fp, report.toStringResult(), report.report(), reportWarnings);
|
||||
|
||||
{
|
||||
JS::AutoSaveExceptionState savedExc(cx);
|
||||
@ -9521,7 +9521,7 @@ js::shell::WarningReporter(JSContext* cx, JSErrorReport* report)
|
||||
}
|
||||
|
||||
// Print the warning.
|
||||
PrintError(cx, fp, JS::ConstUTF8CharsZ(), report, reportWarnings);
|
||||
JS::PrintError(cx, fp, JS::ConstUTF8CharsZ(), report, reportWarnings);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -578,8 +578,8 @@ PrintSingleError(JSContext* cx, FILE* file, JS::ConstUTF8CharsZ toStringResult,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
js::PrintError(JSContext* cx, FILE* file, JS::ConstUTF8CharsZ toStringResult,
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::PrintError(JSContext* cx, FILE* file, JS::ConstUTF8CharsZ toStringResult,
|
||||
JSErrorReport* report, bool reportWarnings)
|
||||
{
|
||||
MOZ_ASSERT(report);
|
||||
|
@ -1071,16 +1071,6 @@ ExpandErrorArgumentsVA(JSContext* cx, JSErrorCallback callback,
|
||||
extern void
|
||||
ReportUsageErrorASCII(JSContext* cx, HandleObject callee, const char* msg);
|
||||
|
||||
/*
|
||||
* Prints a full report and returns true if the given report is non-nullptr
|
||||
* and the report doesn't have the JSREPORT_WARNING flag set or reportWarnings
|
||||
* is true.
|
||||
* Returns false otherwise.
|
||||
*/
|
||||
extern bool
|
||||
PrintError(JSContext* cx, FILE* file, JS::ConstUTF8CharsZ toStringResult,
|
||||
JSErrorReport* report, bool reportWarnings);
|
||||
|
||||
extern void
|
||||
ReportIsNotDefined(JSContext* cx, HandlePropertyName name);
|
||||
|
||||
|
@ -80,7 +80,7 @@ selfHosting_WarningReporter(JSContext* cx, JSErrorReport* report)
|
||||
MOZ_ASSERT(report);
|
||||
MOZ_ASSERT(JSREPORT_IS_WARNING(report->flags));
|
||||
|
||||
PrintError(cx, stderr, JS::ConstUTF8CharsZ(), report, true);
|
||||
JS::PrintError(cx, stderr, JS::ConstUTF8CharsZ(), report, true);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -2894,7 +2894,7 @@ MaybePrintAndClearPendingException(JSContext* cx, FILE* file)
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!JSREPORT_IS_WARNING(report.report()->flags));
|
||||
PrintError(cx, file, report.toStringResult(), report.report(), true);
|
||||
JS::PrintError(cx, file, report.toStringResult(), report.report(), true);
|
||||
}
|
||||
|
||||
class MOZ_STACK_CLASS AutoSelfHostingErrorReporter
|
||||
|
Loading…
Reference in New Issue
Block a user