Backed out changeset a8668eecdab4 (bug 1322560)
authorSteve Fink <sfink@mozilla.com>
Fri, 28 Apr 2017 11:13:08 -0700
changeset 355593 8606077bfecce5768eab15c657a9a52819cbd4a8
parent 355592 85d31cb549035041027c5a09b1e9a36b856626bc
child 355594 1805d0a9e85bceb84157baef009d2fe79cfb84f8
push id89705
push usersfink@mozilla.com
push dateFri, 28 Apr 2017 18:20:04 +0000
treeherdermozilla-inbound@793cb1b17440 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1322560
milestone55.0a1
backs outa8668eecdab4e6cbc89999f95fd13bf66155cf89
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 a8668eecdab4 (bug 1322560)
js/src/vm/JSONPrinter.cpp
js/src/vm/JSONPrinter.h
--- a/js/src/vm/JSONPrinter.cpp
+++ b/js/src/vm/JSONPrinter.cpp
@@ -140,32 +140,16 @@ JSONPrinter::property(const char* name, 
     propertyName(name);
     if (mozilla::IsFinite(value))
         out_.printf("%f", value);
     else
         out_.printf("null");
 }
 
 void
-JSONPrinter::property(const char* name, const mozilla::TimeDuration& dur, TimePrecision precision)
-{
-    propertyName(name);
-    lldiv_t split;
-    switch (precision) {
-      case SECONDS:
-        split = lldiv(static_cast<int64_t>(dur.ToMilliseconds()), 1000);
-        break;
-      case MILLISECONDS:
-        split = lldiv(static_cast<int64_t>(dur.ToMicroseconds()), 1000);
-        break;
-    };
-    out_.printf("%llu.%03llu", split.quot, split.rem);
-}
-
-void
 JSONPrinter::endObject()
 {
     indentLevel_--;
     indent();
     out_.printf("}");
     first_ = false;
 }
 
--- a/js/src/vm/JSONPrinter.h
+++ b/js/src/vm/JSONPrinter.h
@@ -4,18 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef vm_JSONPrinter_h
 #define vm_JSONPrinter_h
 
 #include <stdio.h>
 
-#include "mozilla/TimeStamp.h"
-
 #include "js/TypeDecls.h"
 #include "vm/Printer.h"
 
 namespace js {
 
 class JSONPrinter
 {
   protected:
@@ -40,22 +38,16 @@ class JSONPrinter
     void value(int value);
 
     void property(const char* name, const char* format, ...) MOZ_FORMAT_PRINTF(3, 4);
     void property(const char* name, int value);
     void property(const char* name, uint32_t value);
     void property(const char* name, uint64_t value);
     void property(const char* name, double value);
 
-    // JSON requires decimals to be separated by periods, but the LC_NUMERIC
-    // setting may cause printf to use commas in some locales. Enforce using a
-    // period.
-    enum TimePrecision { SECONDS, MILLISECONDS };
-    void property(const char* name, const mozilla::TimeDuration& dur, TimePrecision precision);
-
     void beginStringProperty(const char* name);
     void endStringProperty();
 
     void endObject();
     void endList();
 
   protected:
     void propertyName(const char* name);