Changeset 128008 in webkit


Ignore:
Timestamp:
Sep 9, 2012 5:45:58 PM (12 years ago)
Author:
Patrick Gansterer
Message:

Replace WTF::numberToString() with String::numberToStringECMAScript()
https://bugs.webkit.org/show_bug.cgi?id=96130

Reviewed by Benjamin Poulain.

The String class provides a nice wrapper for this function
in the meantime, so just use it to avoid code duplication.

  • html/parser/HTMLParserIdioms.cpp:

(WebCore::serializeForNumberType):

  • platform/Decimal.cpp:

(WebCore::Decimal::fromDouble):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128006 r128008  
     12012-09-09  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Replace WTF::numberToString() with String::numberToStringECMAScript()
     4        https://bugs.webkit.org/show_bug.cgi?id=96130
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        The String class provides a nice wrapper for this function
     9        in the meantime, so just use it to avoid code duplication.
     10
     11        * html/parser/HTMLParserIdioms.cpp:
     12        (WebCore::serializeForNumberType):
     13        * platform/Decimal.cpp:
     14        (WebCore::Decimal::fromDouble):
     15
    1162012-09-09  Emil A Eklund  <eae@chromium.org>
    217
  • trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp

    r124998 r128008  
    2929#include <limits>
    3030#include <wtf/MathExtras.h>
    31 #include <wtf/dtoa.h>
    3231#include <wtf/text/AtomicString.h>
    3332#include <wtf/text/StringBuilder.h>
     
    8887    // According to HTML5, "the best representation of the number n as a floating
    8988    // point number" is a string produced by applying ToString() to n.
    90     NumberToStringBuffer buffer;
    91     return String(numberToString(number, buffer));
     89    return String::numberToStringECMAScript(number);
    9290}
    9391
  • trunk/Source/WebCore/platform/Decimal.cpp

    r122928 r128008  
    3838#include <wtf/MathExtras.h>
    3939#include <wtf/Noncopyable.h>
    40 #include <wtf/dtoa.h>
    4140#include <wtf/text/StringBuilder.h>
    4241
     
    682681Decimal Decimal::fromDouble(double doubleValue)
    683682{
    684     if (isfinite(doubleValue)) {
    685         NumberToStringBuffer buffer;
    686         return fromString(numberToString(doubleValue, buffer));
    687     }
     683    if (isfinite(doubleValue))
     684        return fromString(String::numberToStringECMAScript(doubleValue));
    688685
    689686    if (isinf(doubleValue))
Note: See TracChangeset for help on using the changeset viewer.