Changeset 194332 in webkit
- Timestamp:
- Dec 21, 2015 10:20:58 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194328 r194332 1 2015-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 1 13 2015-12-21 Andy VanWagoner <thetalecrafter@gmail.com> 2 14 -
trunk/LayoutTests/js/dom/script-tests/string-prototype-properties.js
r194328 r194332 21 21 shouldThrow("String.prototype.toLowerCase.call(undefined)"); 22 22 shouldThrow("String.prototype.toUpperCase.call(undefined)"); 23 shouldThrow("String.prototype.localeCompare.call(undefined, '1224')" , "'TypeError: String.prototype.localeCompare requires that |this| not be undefined'");23 shouldThrow("String.prototype.localeCompare.call(undefined, '1224')"); 24 24 shouldThrow("String.prototype.toLocaleLowerCase.call(undefined)"); 25 25 shouldThrow("String.prototype.toLocaleUpperCase.call(undefined)"); -
trunk/LayoutTests/js/dom/string-prototype-properties-expected.txt
r194328 r194332 21 21 PASS String.prototype.toLowerCase.call(undefined) threw exception TypeError: Type error. 22 22 PASS 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.23 PASS String.prototype.localeCompare.call(undefined, '1224') threw exception TypeError: Type error. 24 24 PASS String.prototype.toLocaleLowerCase.call(undefined) threw exception TypeError: Type error. 25 25 PASS 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).");1 description("This test checks String.localeCompare()."); 2 2 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.26 3 shouldBeTrue('"a".localeCompare("aa") < 0'); 27 4 shouldBeTrue('"a".localeCompare("b") < 0'); … … 32 9 shouldBeTrue('"aa".localeCompare("a") > 0'); 33 10 shouldBeTrue('"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).1 This test checks String.localeCompare(). 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 PASS String.prototype.localeCompare.length is 17 PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').enumerable is false8 PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').configurable is true9 PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').writable is true10 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.23 6 PASS "a".localeCompare("aa") < 0 is true 24 7 PASS "a".localeCompare("b") < 0 is true … … 27 10 PASS "aa".localeCompare("a") > 0 is true 28 11 PASS "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 -132 PASS 'ä'.localeCompare('z', 'sv') is 133 PASS 'a'.localeCompare('b', 'en', { sensitivity:'base' }) is -134 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'base' }) is 035 PASS 'a'.localeCompare('A', 'en', { sensitivity:'base' }) is 036 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'base' }) is 037 PASS 'a'.localeCompare('b', 'en', { sensitivity:'accent' }) is -138 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'accent' }) is -139 PASS 'a'.localeCompare('A', 'en', { sensitivity:'accent' }) is 040 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'accent' }) is 041 PASS 'a'.localeCompare('b', 'en', { sensitivity:'case' }) is -142 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'case' }) is 043 PASS 'a'.localeCompare('A', 'en', { sensitivity:'case' }) is -144 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'case' }) is 045 PASS 'a'.localeCompare('b', 'en', { sensitivity:'variant' }) is -146 PASS 'a'.localeCompare('ä', 'en', { sensitivity:'variant' }) is -147 PASS 'a'.localeCompare('A', 'en', { sensitivity:'variant' }) is -148 PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'variant' }) is -149 PASS '1'.localeCompare('2', 'en', { numeric:false }) is -150 PASS '2'.localeCompare('10', 'en', { numeric:false }) is 151 PASS '01'.localeCompare('1', 'en', { numeric:false }) is -152 PASS '๑'.localeCompare('๒', 'en', { numeric:false }) is -153 PASS '๒'.localeCompare('๑๐', 'en', { numeric:false }) is 154 PASS '๐๑'.localeCompare('๑', 'en', { numeric:false }) is -155 PASS '1'.localeCompare('2', 'en', { numeric:true }) is -156 PASS '2'.localeCompare('10', 'en', { numeric:true }) is -157 PASS '01'.localeCompare('1', 'en', { numeric:true }) is 058 PASS '๑'.localeCompare('๒', 'en', { numeric:true }) is -159 PASS '๒'.localeCompare('๑๐', 'en', { numeric:true }) is -160 PASS '๐๑'.localeCompare('๑', 'en', { numeric:true }) is 061 12 PASS successfullyParsed is true 62 13 -
trunk/LayoutTests/js/string-localeCompare.html
r194328 r194332 2 2 <html> 3 3 <head> 4 <meta charset="utf-8">5 4 <script src="../resources/js-test-pre.js"></script> 6 5 </head> -
trunk/Source/JavaScriptCore/CMakeLists.txt
r194331 r194332 1251 1251 ${JAVASCRIPTCORE_DIR}/builtins/StringConstructor.js 1252 1252 ${JAVASCRIPTCORE_DIR}/builtins/StringIteratorPrototype.js 1253 ${JAVASCRIPTCORE_DIR}/builtins/StringPrototype.js1254 1253 ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayConstructor.js 1255 1254 ${JAVASCRIPTCORE_DIR}/builtins/TypedArrayPrototype.js -
trunk/Source/JavaScriptCore/ChangeLog
r194331 r194332 1 2015-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 1 13 2015-12-21 Filip Pizlo <fpizlo@apple.com> 2 14 -
trunk/Source/JavaScriptCore/DerivedSources.make
r194328 r194332 99 99 $(JavaScriptCore)/builtins/StringConstructor.js \ 100 100 $(JavaScriptCore)/builtins/StringIteratorPrototype.js \ 101 $(JavaScriptCore)/builtins/StringPrototype.js \102 101 $(JavaScriptCore)/builtins/TypedArrayConstructor.js \ 103 102 $(JavaScriptCore)/builtins/TypedArrayPrototype.js \ -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r194331 r194332 2057 2057 FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2058 2058 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 = (); }; }; 2060 2060 FEB137571BB11EF900CD5100 /* MacroAssemblerARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEB137561BB11EEE00CD5100 /* MacroAssemblerARM64.cpp */; }; 2061 2061 FEB51F6C1A97B688001F921C /* Regress141809.mm in Sources */ = {isa = PBXBuildFile; fileRef = FEB51F6B1A97B688001F921C /* Regress141809.mm */; }; … … 3678 3678 A1D792FA1B43864B004516F5 /* IntlNumberFormatPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlNumberFormatPrototype.cpp; sourceTree = "<group>"; }; 3679 3679 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>"; };3681 3680 A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptCallFrame.cpp; sourceTree = "<group>"; }; 3682 3681 A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCallFrame.h; sourceTree = "<group>"; }; … … 6774 6773 7CF9BC601B65D9B1009DB1EF /* StringConstructor.js */, 6775 6774 7CF9BC611B65D9B1009DB1EF /* StringIteratorPrototype.js */, 6776 A1E0451B1C25B4B100BB663C /* StringPrototype.js */,6777 6775 53917E831B791CB8000EBD33 /* TypedArrayPrototype.js */, 6778 6776 534C457A1BC703DC007476A7 /* TypedArrayConstructor.js */, -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r194328 r194332 30 30 #include "Executable.h" 31 31 #include "IntlObject.h" 32 #include "JSCBuiltins.h"33 32 #include "JSCInlines.h" 34 33 #include "JSGlobalObjectFunctions.h" … … 132 131 JSC_NATIVE_FUNCTION("toLowerCase", stringProtoFuncToLowerCase, DontEnum, 0); 133 132 JSC_NATIVE_FUNCTION("toUpperCase", stringProtoFuncToUpperCase, DontEnum, 0); 133 JSC_NATIVE_FUNCTION("localeCompare", stringProtoFuncLocaleCompare, DontEnum, 1); 134 134 #if ENABLE(INTL) 135 JSC_BUILTIN_FUNCTION("localeCompare", stringPrototypeLocaleCompareCodeGenerator, DontEnum);136 135 JSC_NATIVE_FUNCTION("toLocaleLowerCase", stringProtoFuncToLocaleLowerCase, DontEnum, 0); 137 136 JSC_NATIVE_FUNCTION("toLocaleUpperCase", stringProtoFuncToLocaleUpperCase, DontEnum, 0); 138 137 #else 139 JSC_NATIVE_FUNCTION("localeCompare", stringProtoFuncLocaleCompare, DontEnum, 1);140 138 JSC_NATIVE_FUNCTION("toLocaleLowerCase", stringProtoFuncToLowerCase, DontEnum, 0); 141 139 JSC_NATIVE_FUNCTION("toLocaleUpperCase", stringProtoFuncToUpperCase, DontEnum, 0);
Note: See TracChangeset
for help on using the changeset viewer.