1bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// Copyright 2013 the V8 project authors. All rights reserved. 2bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// Redistribution and use in source and binary forms, with or without 3bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// modification, are permitted provided that the following conditions are 4bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// met: 5bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// 6bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// * Redistributions of source code must retain the above copyright 7bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// notice, this list of conditions and the following disclaimer. 8bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// * Redistributions in binary form must reproduce the above 9bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// copyright notice, this list of conditions and the following 10bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// disclaimer in the documentation and/or other materials provided 11bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// with the distribution. 12bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// * Neither the name of Google Inc. nor the names of its 13bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// contributors may be used to endorse or promote products derived 14bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// from this software without specific prior written permission. 15bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// 16bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 28bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org// Make sure that zh locales map properly, i.e. don't map zh-TW to zh. 29bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 30bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgvar nf = Intl.NumberFormat(['zh-TW'], {localeMatcher: 'lookup'}); 31bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('zh-TW', nf.resolvedOptions().locale); 32bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 33bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgvar nf = Intl.NumberFormat(['zh-Hant-TW'], {localeMatcher: 'lookup'}); 34bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('zh-Hant-TW', nf.resolvedOptions().locale); 35bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 36bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgvar nf = Intl.NumberFormat(['zh-Hant'], {localeMatcher: 'lookup'}); 37bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('zh-Hant', nf.resolvedOptions().locale); 38bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 39bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgnf = Intl.NumberFormat(['zh'], {localeMatcher: 'lookup'}); 40bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('zh', nf.resolvedOptions().locale); 41bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 42bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgnf = Intl.NumberFormat(['zh-CN'], {localeMatcher: 'lookup'}); 43bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('zh-CN', nf.resolvedOptions().locale); 44bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 45bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgnf = Intl.NumberFormat(['zh-Hans-CN'], {localeMatcher: 'lookup'}); 46bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('zh-Hans-CN', nf.resolvedOptions().locale); 47bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 48bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgnf = Intl.NumberFormat(['zh-Hans'], {localeMatcher: 'lookup'}); 49bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('zh-Hans', nf.resolvedOptions().locale); 50bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.org 51bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgnf = Intl.NumberFormat(['en-US'], {localeMatcher: 'lookup'}); 52bee51999422c0eeaae85ed99b5c0bd4126510ff1danno@chromium.orgassertEquals('en-US', nf.resolvedOptions().locale); 53