constructor-newtarget-undefined.js (623B)
1 // Copyright 2018 Igalia, S.L. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-intl.locale 6 description: > 7 Verifies the NewTarget check for Intl.Locale. 8 info: | 9 Intl.Locale( tag [, options] ) 10 11 1. If NewTarget is undefined, throw a TypeError exception. 12 features: [Intl.Locale] 13 ---*/ 14 15 assert.sameValue(typeof Intl.Locale, "function"); 16 17 assert.throws(TypeError, function() { 18 Intl.Locale(); 19 }, 'Intl.Locale() throws TypeError'); 20 21 assert.throws(TypeError, function() { 22 Intl.Locale("en"); 23 }, 'Intl.Locale("en") throws TypeError'); 24 25 reportCompare(0, 0);