Ignore:
Timestamp:
Dec 4, 2015, 5:14:03 PM (10 years ago)
Author:
[email protected]
Message:

[INTL] Implement Number.prototype.toLocaleString in ECMA-402
https://bugs.webkit.org/show_bug.cgi?id=147610

Patch by Andy VanWagoner <[email protected]> on 2015-12-04
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Add toLocaleString in builtin JavaScript that delegates formatting to Intl.NumberFormat.
Keep exisiting native implementation for use if INTL flag is disabled.

  • CMakeLists.txt: Add NumberPrototype.js.
  • DerivedSources.make: Add NumberPrototype.js.
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • builtins/NumberPrototype.js: Added.

(toLocaleString):

  • runtime/CommonIdentifiers.h: Add private names for Intl constructors.
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init): Expose Intl constructors to builtin js.

  • runtime/NumberPrototype.cpp:

(JSC::NumberPrototype::finishCreation): Replace toLocaleString implementation.

LayoutTests:

Add tests for ECMA-402 Number.prototype.toLocaleString.
Since NumberFormat is not fully implemented, don't test locale-specific behavior yet.

  • js/number-toLocaleString-expected.txt: Added.
  • js/number-toLocaleString.html: Added.
  • js/script-tests/number-toLocaleString.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r193491 r193493  
     12015-12-04  Andy VanWagoner  <[email protected]>
     2
     3        [INTL] Implement Number.prototype.toLocaleString in ECMA-402
     4        https://bugs.webkit.org/show_bug.cgi?id=147610
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Add toLocaleString in builtin JavaScript that delegates formatting to Intl.NumberFormat.
     9        Keep exisiting native implementation for use if INTL flag is disabled.
     10
     11        * CMakeLists.txt: Add NumberPrototype.js.
     12        * DerivedSources.make: Add NumberPrototype.js.
     13        * JavaScriptCore.xcodeproj/project.pbxproj:
     14        * builtins/NumberPrototype.js: Added.
     15        (toLocaleString):
     16        * runtime/CommonIdentifiers.h: Add private names for Intl constructors.
     17        * runtime/JSGlobalObject.cpp:
     18        (JSC::JSGlobalObject::init): Expose Intl constructors to builtin js.
     19        * runtime/NumberPrototype.cpp:
     20        (JSC::NumberPrototype::finishCreation): Replace toLocaleString implementation.
     21
    1222015-12-04  Michael Saboff  <[email protected]>
    223
Note: See TracChangeset for help on using the changeset viewer.