diff options
author | weinig <weinig@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2007-05-26 21:57:28 +0000 |
---|---|---|
committer | weinig <weinig@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2007-05-26 21:57:28 +0000 |
commit | 00a00c13901d81666443a984a66eb3bd1c3bdd73 (patch) | |
tree | 17d415ab96003938d31b650050168851a68cfb7c /third_party/WebKit/LayoutTests/fast/js/kde/resources | |
parent | 2fb344d90b8e8b2aac3eca95bacffff707a3fa47 (diff) | |
download | chromium_src-00a00c13901d81666443a984a66eb3bd1c3bdd73.zip chromium_src-00a00c13901d81666443a984a66eb3bd1c3bdd73.tar.gz chromium_src-00a00c13901d81666443a984a66eb3bd1c3bdd73.tar.bz2 |
JavaScriptCore:
Reviewed by Darin.
Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
Port of commit 667785 from kjs
- special case calling String.localeCompare() with no parameters to return 0.
* kjs/string_object.cpp:
(KJS::StringProtoFunc::callAsFunction):
LayoutTests:
Reviewed by Darin.
Update tests http://bugs.webkit.org/show_bug.cgi?id=13854
Port of commit 667785 from kjs
- update tests and results to match kde.
* fast/js/kde/StringObject-expected.txt:
* fast/js/kde/resources/StringObject.js:
git-svn-id: svn://svn.chromium.org/blink/trunk@21806 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/js/kde/resources')
-rw-r--r-- | third_party/WebKit/LayoutTests/fast/js/kde/resources/StringObject.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/js/kde/resources/StringObject.js b/third_party/WebKit/LayoutTests/fast/js/kde/resources/StringObject.js index 59c7bb6..c1bcc0f 100644 --- a/third_party/WebKit/LayoutTests/fast/js/kde/resources/StringObject.js +++ b/third_party/WebKit/LayoutTests/fast/js/kde/resources/StringObject.js @@ -91,14 +91,28 @@ shouldBe("'axxb'.split(/x*/) + ''", "'a,b'"); // NS 4.7 is wrong here // String.prototype.slice() shouldBe("'abcdef'.slice(2, 5)", "'cde'"); shouldBe("'abcdefghijklmnopqrstuvwxyz1234567890'.slice(-32, -6)", - "'efghijklmnopqrstuvwxyz1234'"); + "'efghijklmnopqrstuvwxyz1234'"); shouldBe("'abC1'.toUpperCase()", "'ABC1'"); shouldBe("'AbC2'.toLowerCase()", "'abc2'"); +// String.prototype.localeCompare() +// ### not really testing the locale aspect +shouldBe("'a'.localeCompare('a')", "0"); +shouldBe("'a'.localeCompare('aa') < 0", "true"); +shouldBe("'a'.localeCompare('x') < 0", "true"); +shouldBe("'x'.localeCompare('a') > 0", "true"); +shouldBe("''.localeCompare('')", "0"); +shouldBe("''.localeCompare()", "0"); +shouldBe("''.localeCompare(undefined)", "-1"); +shouldBe("''.localeCompare(null)", "-1"); +shouldBe("'a'.localeCompare('')", "1"); +shouldBe("'a'.localeCompare()", "0"); + // warning: prototype modification below shouldBe("'abc'[0]", "'a'"); shouldBeUndefined("'abc'[-1]"); +shouldBeUndefined("'abc'[-4]"); shouldBeUndefined("'abc'[10]"); String.prototype[10] = "x"; shouldBe("'abc'[10]", "'x'"); |