| 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);
|
|
|