Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Unified Diff: test/intl/general/mapped-locale.js

Issue 148883002: Synchronize with r15594. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/intl/general/empty-handle.js ('k') | test/intl/general/supported-locales-of.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/general/mapped-locale.js
diff --git a/test/mjsunit/regress/setter.js b/test/intl/general/mapped-locale.js
similarity index 61%
copy from test/mjsunit/regress/setter.js
copy to test/intl/general/mapped-locale.js
index e3a8000f2bc55c9ee09c483a1cc421305415b85d..17151b557f40271873ff80ff63f236c332d4979f 100644
--- a/test/mjsunit/regress/setter.js
+++ b/test/intl/general/mapped-locale.js
@@ -25,42 +25,28 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function s(v) {
- v.x = 1;
-}
+// Make sure that zh locales map properly, i.e. don't map zh-TW to zh.
-function c(p) {
- return {__proto__: p};
-}
+var nf = Intl.NumberFormat(['zh-TW'], {localeMatcher: 'lookup'});
+assertEquals('zh-TW', nf.resolvedOptions().locale);
-var p = {};
+var nf = Intl.NumberFormat(['zh-Hant-TW'], {localeMatcher: 'lookup'});
+assertEquals('zh-Hant-TW', nf.resolvedOptions().locale);
-var o1 = c(p);
-var o2 = c(p);
-var o3 = c(p);
-var o4 = c(p);
-var o5 = c(p);
+var nf = Intl.NumberFormat(['zh-Hant'], {localeMatcher: 'lookup'});
+assertEquals('zh-Hant', nf.resolvedOptions().locale);
-// Initialize the store IC.
-s(o1);
-s(o2);
+nf = Intl.NumberFormat(['zh'], {localeMatcher: 'lookup'});
+assertEquals('zh', nf.resolvedOptions().locale);
-// Install a setter on p.x
-var count = 0;
-Object.defineProperty(p, "x", {
- set: function(x) {
- count += 1;
- }
-});
+nf = Intl.NumberFormat(['zh-CN'], {localeMatcher: 'lookup'});
+assertEquals('zh-CN', nf.resolvedOptions().locale);
-// Verify that the setter was called directly.
-o3.x = 20;
-assertEquals(1, count);
+nf = Intl.NumberFormat(['zh-Hans-CN'], {localeMatcher: 'lookup'});
+assertEquals('zh-Hans-CN', nf.resolvedOptions().locale);
-// Verify that monomorphic prototype failure is triggered in the IC.
-s(o4);
-assertEquals(2, count);
+nf = Intl.NumberFormat(['zh-Hans'], {localeMatcher: 'lookup'});
+assertEquals('zh-Hans', nf.resolvedOptions().locale);
-// Verify that the newly installed IC is correct.
-s(o5);
-assertEquals(3, count);
+nf = Intl.NumberFormat(['en-US'], {localeMatcher: 'lookup'});
+assertEquals('en-US', nf.resolvedOptions().locale);
« no previous file with comments | « test/intl/general/empty-handle.js ('k') | test/intl/general/supported-locales-of.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698