Changeset 194332 in webkit


Ignore:
Timestamp:
Dec 21, 2015 10:20:58 AM (8 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r194328.

This change appears to have caused failures in JSC tests

Reverted changeset:

"[INTL] Implement String.prototype.localeCompare in ECMA-402"
https://bugs.webkit.org/show_bug.cgi?id=147607
http://trac.webkit.org/changeset/194328

Location:
trunk
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194328 r194332  
     12015-12-21  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r194328.
     4
     5        This change appears to have caused failures in JSC tests
     6
     7        Reverted changeset:
     8
     9        "[INTL] Implement String.prototype.localeCompare in ECMA-402"
     10        https://bugs.webkit.org/show_bug.cgi?id=147607
     11        http://trac.webkit.org/changeset/194328
     12
    1132015-12-21  Andy VanWagoner  <thetalecrafter@gmail.com>
    214
  • trunk/LayoutTests/js/dom/script-tests/string-prototype-properties.js

    r194328 r194332  
    2121shouldThrow("String.prototype.toLowerCase.call(undefined)");
    2222shouldThrow("String.prototype.toUpperCase.call(undefined)");
    23 shouldThrow("String.prototype.localeCompare.call(undefined, '1224')", "'TypeError: String.prototype.localeCompare requires that |this| not be undefined'");
     23shouldThrow("String.prototype.localeCompare.call(undefined, '1224')");
    2424shouldThrow("String.prototype.toLocaleLowerCase.call(undefined)");
    2525shouldThrow("String.prototype.toLocaleUpperCase.call(undefined)");
  • trunk/LayoutTests/js/dom/string-prototype-properties-expected.txt

    r194328 r194332  
    2121PASS String.prototype.toLowerCase.call(undefined) threw exception TypeError: Type error.
    2222PASS String.prototype.toUpperCase.call(undefined) threw exception TypeError: Type error.
    23 PASS String.prototype.localeCompare.call(undefined, '1224') threw exception TypeError: String.prototype.localeCompare requires that |this| not be undefined.
     23PASS String.prototype.localeCompare.call(undefined, '1224') threw exception TypeError: Type error.
    2424PASS String.prototype.toLocaleLowerCase.call(undefined) threw exception TypeError: Type error.
    2525PASS String.prototype.toLocaleUpperCase.call(undefined) threw exception TypeError: Type error.
  • trunk/LayoutTests/js/script-tests/string-localeCompare.js

    r194328 r194332  
    1 description("This test checks the behavior of String.prototype.localeCompare as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).");
     1description("This test checks String.localeCompare().");
    22
    3 shouldBe("String.prototype.localeCompare.length", "1");
    4 shouldBeFalse("Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').enumerable");
    5 shouldBeTrue("Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').configurable");
    6 shouldBeTrue("Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').writable");
    7 
    8 // Test RequireObjectCoercible.
    9 shouldThrow("String.prototype.localeCompare.call()", "'TypeError: String.prototype.localeCompare requires that |this| not be undefined'");
    10 shouldThrow("String.prototype.localeCompare.call(undefined)", "'TypeError: String.prototype.localeCompare requires that |this| not be undefined'");
    11 shouldThrow("String.prototype.localeCompare.call(null)", "'TypeError: String.prototype.localeCompare requires that |this| not be null'");
    12 shouldNotThrow("String.prototype.localeCompare.call({}, '')");
    13 shouldNotThrow("String.prototype.localeCompare.call([], '')");
    14 shouldNotThrow("String.prototype.localeCompare.call(NaN, '')");
    15 shouldNotThrow("String.prototype.localeCompare.call(5, '')");
    16 shouldNotThrow("String.prototype.localeCompare.call('', '')");
    17 shouldNotThrow("String.prototype.localeCompare.call(() => {}, '')");
    18 
    19 // Test toString fails.
    20 shouldThrow("''.localeCompare.call({ toString() { throw 'thisFail' } }, '')", "'thisFail'");
    21 shouldThrow("''.localeCompare({ toString() { throw 'thatFail' } })", "'thatFail'");
    22 shouldNotThrow("''.localeCompare()");
    23 shouldNotThrow("''.localeCompare(null)");
    24 
    25 // Basic support.
    263shouldBeTrue('"a".localeCompare("aa") < 0');
    274shouldBeTrue('"a".localeCompare("b") < 0');
     
    329shouldBeTrue('"aa".localeCompare("a") > 0');
    3310shouldBeTrue('"b".localeCompare("a") > 0');
    34 
    35 // Uses Intl.Collator.
    36 shouldThrow("'a'.localeCompare('b', '$')", "'RangeError: invalid language tag: $'");
    37 shouldThrow("'a'.localeCompare('b', 'en', {usage: 'Sort'})", '\'RangeError: usage must be either "sort" or "search"\'');
    38 
    39 shouldBe("'ä'.localeCompare('z', 'en')", "-1");
    40 shouldBe("'ä'.localeCompare('z', 'sv')", "1");
    41 
    42 shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'base' })", "-1");
    43 shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'base' })", "0");
    44 shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'base' })", "0");
    45 shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'base' })", "0");
    46 
    47 shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'accent' })", "-1");
    48 shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'accent' })", "-1");
    49 shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'accent' })", "0");
    50 shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'accent' })", "0");
    51 
    52 shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'case' })", "-1");
    53 shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'case' })", "0");
    54 shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'case' })", "-1");
    55 shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'case' })", "0");
    56 
    57 shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'variant' })", "-1");
    58 shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'variant' })", "-1");
    59 shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'variant' })", "-1");
    60 shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'variant' })", "-1");
    61 
    62 shouldBe("'1'.localeCompare('2', 'en', { numeric:false })", "-1");
    63 shouldBe("'2'.localeCompare('10', 'en', { numeric:false })", "1");
    64 shouldBe("'01'.localeCompare('1', 'en', { numeric:false })", "-1");
    65 shouldBe("'๑'.localeCompare('๒', 'en', { numeric:false })", "-1");
    66 shouldBe("'๒'.localeCompare('๑๐', 'en', { numeric:false })", "1");
    67 shouldBe("'๐๑'.localeCompare('๑', 'en', { numeric:false })", "-1");
    68 
    69 shouldBe("'1'.localeCompare('2', 'en', { numeric:true })", "-1");
    70 shouldBe("'2'.localeCompare('10', 'en', { numeric:true })", "-1");
    71 shouldBe("'01'.localeCompare('1', 'en', { numeric:true })", "0");
    72 shouldBe("'๑'.localeCompare('๒', 'en', { numeric:true })", "-1");
    73 shouldBe("'๒'.localeCompare('๑๐', 'en', { numeric:true })", "-1");
    74 shouldBe("'๐๑'.localeCompare('๑', 'en', { numeric:true })", "0");
    75 
  • trunk/LayoutTests/js/string-localeCompare-expected.txt

    r194328 r194332  
    1 This test checks the behavior of String.prototype.localeCompare as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
     1This test checks String.localeCompare().
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    55
    6 PASS String.prototype.localeCompare.length is 1
    7 PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').enumerable is false
    8 PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').configurable is true
    9 PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').writable is true
    10 PASS String.prototype.localeCompare.call() threw exception TypeError: String.prototype.localeCompare requires that |this| not be undefined.
    11 PASS String.prototype.localeCompare.call(undefined) threw exception TypeError: String.prototype.localeCompare requires that |this| not be undefined.
    12 PASS String.prototype.localeCompare.call(null) threw exception TypeError: String.prototype.localeCompare requires that |this| not be null.
    13 PASS String.prototype.localeCompare.call({}, '') did not throw exception.
    14 PASS String.prototype.localeCompare.call([], '') did not throw exception.
    15 PASS String.prototype.localeCompare.call(NaN, '') did not throw exception.
    16 PASS String.prototype.localeCompare.call(5, '') did not throw exception.
    17 PASS String.prototype.localeCompare.call('', '') did not throw exception.
    18 PASS String.prototype.localeCompare.call(() => {}, '') did not throw exception.
    19 PASS ''.localeCompare.call({ toString() { throw 'thisFail' } }, '') threw exception thisFail.
    20 PASS ''.localeCompare({ toString() { throw 'thatFail' } }) threw exception thatFail.
    21 PASS ''.localeCompare() did not throw exception.
    22 PASS ''.localeCompare(null) did not throw exception.
    236PASS "a".localeCompare("aa") < 0 is true
    247PASS "a".localeCompare("b") < 0 is true
     
    2710PASS "aa".localeCompare("a") > 0 is true
    2811PASS "b".localeCompare("a") > 0 is true
    29 PASS 'a'.localeCompare('b', '$') threw exception RangeError: invalid language tag: $.
    30 PASS 'a'.localeCompare('b', 'en', {usage: 'Sort'}) threw exception RangeError: usage must be either "sort" or "search".
    31 PASS 'ä'.localeCompare('z', 'en') is -1
    32 PASS 'ä'.localeCompare('z', 'sv') is 1
    33 PASS 'a'.localeCompare('b', 'en', { sensitivity:'base' }) is -1
    34 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'base' }) is 0
    35 PASS 'a'.localeCompare('A', 'en', { sensitivity:'base' }) is 0
    36 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'base' }) is 0
    37 PASS 'a'.localeCompare('b', 'en', { sensitivity:'accent' }) is -1
    38 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'accent' }) is -1
    39 PASS 'a'.localeCompare('A', 'en', { sensitivity:'accent' }) is 0
    40 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'accent' }) is 0
    41 PASS 'a'.localeCompare('b', 'en', { sensitivity:'case' }) is -1
    42 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'case' }) is 0
    43 PASS 'a'.localeCompare('A', 'en', { sensitivity:'case' }) is -1
    44 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'case' }) is 0
    45 PASS 'a'.localeCompare('b', 'en', { sensitivity:'variant' }) is -1
    46 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'variant' }) is -1
    47 PASS 'a'.localeCompare('A', 'en', { sensitivity:'variant' }) is -1
    48 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'variant' }) is -1
    49 PASS '1'.localeCompare('2', 'en', { numeric:false }) is -1
    50 PASS '2'.localeCompare('10', 'en', { numeric:false }) is 1
    51 PASS '01'.localeCompare('1', 'en', { numeric:false }) is -1
    52 PASS '๑'.localeCompare('๒', 'en', { numeric:false }) is -1
    53 PASS '๒'.localeCompare('๑๐', 'en', { numeric:false }) is 1
    54 PASS '๐๑'.localeCompare('๑', 'en', { numeric:false }) is -1
    55 PASS '1'.localeCompare('2', 'en', { numeric:true }) is -1
    56 PASS '2'.localeCompare('10', 'en', { numeric:true }) is -1
    57 PASS '01'.localeCompare('1', 'en', { numeric:true }) is 0
    58 PASS '๑'.localeCompare('๒', 'en', { numeric:true }) is -1
    59 PASS '๒'.localeCompare('๑๐', 'en', { numeric:true }) is -1
    60 PASS '๐๑'.localeCompare('๑', 'en', { numeric:true }) is 0
    6112PASS successfullyParsed is true
    6213
  • trunk/LayoutTests/js/string-localeCompare.html

    r194328 r194332  
    22<html>
    33<head>
    4 <meta charset="utf-8">
    54<script src="../resources/js-test-pre.js"></script>
    65</head>
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r194331 r194332  
    12511251    ${JAVASCRIPTCORE_DIR}/builtins/StringConstructor.js
    12521252    ${JAVASCRIPTCORE_DIR}/builtins/StringIteratorPrototype.js
    1253     ${JAVASCRIPTCORE_DIR}/builtins/StringPrototype.js
    12541253    ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayConstructor.js
    12551254    ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayPrototype.js
  • trunk/Source/JavaScriptCore/ChangeLog

    r194331 r194332  
     12015-12-21  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r194328.
     4
     5        This change appears to have caused failures in JSC tests
     6
     7        Reverted changeset:
     8
     9        "[INTL] Implement String.prototype.localeCompare in ECMA-402"
     10        https://bugs.webkit.org/show_bug.cgi?id=147607
     11        http://trac.webkit.org/changeset/194328
     12
    1132015-12-21  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Source/JavaScriptCore/DerivedSources.make

    r194328 r194332  
    9999    $(JavaScriptCore)/builtins/StringConstructor.js \
    100100    $(JavaScriptCore)/builtins/StringIteratorPrototype.js \
    101     $(JavaScriptCore)/builtins/StringPrototype.js \
    102101    $(JavaScriptCore)/builtins/TypedArrayConstructor.js \
    103102    $(JavaScriptCore)/builtins/TypedArrayPrototype.js \
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r194331 r194332  
    20572057                FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
    20582058                FEA08621182B7A0400F6D851 /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; };
    2059                 FEA1E4391C213A2B00277A16 /* ValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEA1E4381C213A2600277A16 /* ValueProfile.cpp */; };
     2059                FEA1E4391C213A2B00277A16 /* ValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEA1E4381C213A2600277A16 /* ValueProfile.cpp */; settings = {ASSET_TAGS = (); }; };
    20602060                FEB137571BB11EF900CD5100 /* MacroAssemblerARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEB137561BB11EEE00CD5100 /* MacroAssemblerARM64.cpp */; };
    20612061                FEB51F6C1A97B688001F921C /* Regress141809.mm in Sources */ = {isa = PBXBuildFile; fileRef = FEB51F6B1A97B688001F921C /* Regress141809.mm */; };
     
    36783678                A1D792FA1B43864B004516F5 /* IntlNumberFormatPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlNumberFormatPrototype.cpp; sourceTree = "<group>"; };
    36793679                A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormatPrototype.h; sourceTree = "<group>"; };
    3680                 A1E0451B1C25B4B100BB663C /* StringPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = StringPrototype.js; sourceTree = "<group>"; };
    36813680                A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptCallFrame.cpp; sourceTree = "<group>"; };
    36823681                A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCallFrame.h; sourceTree = "<group>"; };
     
    67746773                                7CF9BC601B65D9B1009DB1EF /* StringConstructor.js */,
    67756774                                7CF9BC611B65D9B1009DB1EF /* StringIteratorPrototype.js */,
    6776                                 A1E0451B1C25B4B100BB663C /* StringPrototype.js */,
    67776775                                53917E831B791CB8000EBD33 /* TypedArrayPrototype.js */,
    67786776                                534C457A1BC703DC007476A7 /* TypedArrayConstructor.js */,
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r194328 r194332  
    3030#include "Executable.h"
    3131#include "IntlObject.h"
    32 #include "JSCBuiltins.h"
    3332#include "JSCInlines.h"
    3433#include "JSGlobalObjectFunctions.h"
     
    132131    JSC_NATIVE_FUNCTION("toLowerCase", stringProtoFuncToLowerCase, DontEnum, 0);
    133132    JSC_NATIVE_FUNCTION("toUpperCase", stringProtoFuncToUpperCase, DontEnum, 0);
     133    JSC_NATIVE_FUNCTION("localeCompare", stringProtoFuncLocaleCompare, DontEnum, 1);
    134134#if ENABLE(INTL)
    135     JSC_BUILTIN_FUNCTION("localeCompare", stringPrototypeLocaleCompareCodeGenerator, DontEnum);
    136135    JSC_NATIVE_FUNCTION("toLocaleLowerCase", stringProtoFuncToLocaleLowerCase, DontEnum, 0);
    137136    JSC_NATIVE_FUNCTION("toLocaleUpperCase", stringProtoFuncToLocaleUpperCase, DontEnum, 0);
    138137#else
    139     JSC_NATIVE_FUNCTION("localeCompare", stringProtoFuncLocaleCompare, DontEnum, 1);
    140138    JSC_NATIVE_FUNCTION("toLocaleLowerCase", stringProtoFuncToLowerCase, DontEnum, 0);
    141139    JSC_NATIVE_FUNCTION("toLocaleUpperCase", stringProtoFuncToUpperCase, DontEnum, 0);
Note: See TracChangeset for help on using the changeset viewer.