Add ECMAScript Number to String conversion to WTF::String
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2012 18:57:57 +0000 (18:57 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2012 18:57:57 +0000 (18:57 +0000)
commit3b6bd598ef57a2191aea54d5dfb771ac06c60b24
tree6ae8208fe3422fca0b288dd5fd4cd680f43f87ec
parent3be2613eced081a8a06b4c6eeefbf25e9d8d8e91
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/ParserArena.h
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/NumberPrototype.cpp
Source/JavaScriptCore/runtime/NumericStrings.h
Source/JavaScriptCore/runtime/UString.cpp
Source/JavaScriptCore/runtime/UString.h
Source/WTF/ChangeLog
Source/WTF/wtf/text/WTFString.cpp
Source/WTF/wtf/text/WTFString.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp