Backed out changeset 26933ef9fa13 (bug 1506323) for landing the wrong patch.
authorCosmin Sabou <csabou@mozilla.com>
Sat, 17 Nov 2018 04:39:49 +0200
changeset 446883 22e8321b69f180a1d74975fd8f162326a49d0efe
parent 446882 38844846c6ae6773afb8b9254bf3dbfec437d1ec
child 446884 b3ca607f2595dba7b94124868581c62a9fce668d
push id35052
push userapavel@mozilla.com
push dateSat, 17 Nov 2018 11:25:40 +0000
treeherdermozilla-central@efc1da42132b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1506323
milestone65.0a1
backs out26933ef9fa13275dd7005d1db78f5268008c25b0
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
Backed out changeset 26933ef9fa13 (bug 1506323) for landing the wrong patch.
js/src/jsapi.h
js/src/shell/js.cpp
js/src/vm/JSContext.cpp
js/src/vm/JSContext.h
js/src/vm/SelfHosting.cpp
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -4296,26 +4296,16 @@ SetWarningReporter(JSContext* cx, Warnin
 extern JS_PUBLIC_API(WarningReporter)
 GetWarningReporter(JSContext* cx);
 
 extern JS_PUBLIC_API(bool)
 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);
-
 /************************************************************************/
 
 /*
  * Weak Maps.
  */
 
 extern JS_PUBLIC_API(JSObject*)
 NewWeakMapObject(JSContext* cx);
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -9470,17 +9470,17 @@ js::shell::AutoReportException::~AutoRep
         fflush(stderr);
         JS_ClearPendingException(cx);
         return;
     }
 
     MOZ_ASSERT(!JSREPORT_IS_WARNING(report.report()->flags));
 
     FILE* fp = ErrorFilePointer();
-    JS::PrintError(cx, fp, report.toStringResult(), report.report(), reportWarnings);
+    PrintError(cx, fp, report.toStringResult(), report.report(), reportWarnings);
 
     {
         JS::AutoSaveExceptionState savedExc(cx);
         if (!PrintStackTrace(cx, exn)) {
             fputs("(Unable to print stack trace)\n", fp);
         }
         savedExc.restore();
     }
@@ -9516,17 +9516,17 @@ js::shell::WarningReporter(JSContext* cx
         if (!CreateLastWarningObject(cx, report)) {
             fputs("Unhandled error happened while creating last warning object.\n", fp);
             fflush(fp);
         }
         savedExc.restore();
     }
 
     // Print the warning.
-    JS::PrintError(cx, fp, JS::ConstUTF8CharsZ(), report, reportWarnings);
+    PrintError(cx, fp, JS::ConstUTF8CharsZ(), report, reportWarnings);
 }
 
 static bool
 global_enumerate(JSContext* cx, JS::HandleObject obj, JS::AutoIdVector& properties,
                  bool enumerableOnly)
 {
 #ifdef LAZY_STANDARD_CLASSES
     return JS_NewEnumerateStandardClasses(cx, obj, properties, enumerableOnly);
--- a/js/src/vm/JSContext.cpp
+++ b/js/src/vm/JSContext.cpp
@@ -573,18 +573,18 @@ PrintSingleError(JSContext* cx, FILE* fi
 
     PrintErrorLine(file, prefix.get(), report);
     fputc('\n', file);
 
     fflush(file);
     return true;
 }
 
-JS_PUBLIC_API(bool)
-JS::PrintError(JSContext* cx, FILE* file, JS::ConstUTF8CharsZ toStringResult,
+bool
+js::PrintError(JSContext* cx, FILE* file, JS::ConstUTF8CharsZ toStringResult,
                JSErrorReport* report, bool reportWarnings)
 {
     MOZ_ASSERT(report);
 
     /* Conditionally ignore reported warnings. */
     if (JSREPORT_IS_WARNING(report->flags) && !reportWarnings) {
         return false;
     }
--- a/js/src/vm/JSContext.h
+++ b/js/src/vm/JSContext.h
@@ -1066,16 +1066,26 @@ ExpandErrorArgumentsVA(JSContext* cx, JS
                        const char16_t** messageArgs,
                        ErrorArgumentsType argumentsType,
                        JSErrorNotes::Note* notep, va_list ap);
 
 /* |callee| requires a usage string provided by JS_DefineFunctionsWithHelp. */
 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);
 
 extern void
 ReportIsNotDefined(JSContext* cx, HandleId id);
 
 /*
  * Report an attempt to access the property of a null or undefined value (v).
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -75,17 +75,17 @@ using mozilla::IsInRange;
 using mozilla::Maybe;
 
 static void
 selfHosting_WarningReporter(JSContext* cx, JSErrorReport* report)
 {
     MOZ_ASSERT(report);
     MOZ_ASSERT(JSREPORT_IS_WARNING(report->flags));
 
-    JS::PrintError(cx, stderr, JS::ConstUTF8CharsZ(), report, true);
+    PrintError(cx, stderr, JS::ConstUTF8CharsZ(), report, true);
 }
 
 static bool
 intrinsic_ToObject(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     JSObject* obj = ToObject(cx, args[0]);
     if (!obj) {
@@ -2889,17 +2889,17 @@ MaybePrintAndClearPendingException(JSCon
 
     ErrorReport report(cx);
     if (!report.init(cx, exn, js::ErrorReport::WithSideEffects)) {
         fprintf(file, "out of memory initializing ErrorReport\n");
         return;
     }
 
     MOZ_ASSERT(!JSREPORT_IS_WARNING(report.report()->flags));
-    JS::PrintError(cx, file, report.toStringResult(), report.report(), true);
+    PrintError(cx, file, report.toStringResult(), report.report(), true);
 }
 
 class MOZ_STACK_CLASS AutoSelfHostingErrorReporter
 {
     JSContext* cx_;
     JS::WarningReporter oldReporter_;
 
   public: