Ignore:
Timestamp:
Aug 27, 2012, 11:57:57 AM (13 years ago)
Author:
[email protected]
Message:

Add ECMAScript Number to String conversion to WTF::String
https://bugs.webkit.org/show_bug.cgi?id=95016

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Rename UString::number(double) to UString::numberToStringECMAScript(double) to
differenciate it from the fixed-width conversion performed by String::number().

  • parser/ParserArena.h:

(JSC::IdentifierArena::makeNumericIdentifier):

  • runtime/JSONObject.cpp:

(JSC::Stringifier::appendStringifiedValue):

  • runtime/NumberPrototype.cpp:

(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToPrecision):
(JSC::numberProtoFuncToString):

  • runtime/NumericStrings.h:

(JSC::NumericStrings::add):

  • runtime/UString.cpp:

(JSC::UString::numberToStringECMAScript):

  • runtime/UString.h:

(UString):

Source/WTF:

  • wtf/text/WTFString.cpp:

(WTF::String::numberToStringECMAScript):

  • wtf/text/WTFString.h:

Add the implementation of numberToStringECMAScript(double) from UString to String.
This will make it easier to replace UString in the future.

Tools:

  • TestWebKitAPI/Tests/WTF/WTFString.cpp:

(TestWebKitAPI::testNumberToStringECMAScript):
(TestWebKitAPI): Add tests for String's ECMAString number conversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r119117 r126781  
    388388            builder.append("null");
    389389        else
    390             builder.append(UString::number(number));
     390            builder.append(UString::numberToStringECMAScript(number));
    391391        return StringifySucceeded;
    392392    }
Note: See TracChangeset for help on using the changeset viewer.