supportedLocalesOf-throws-if-element-not-string-or-object.js (672B)
1 // Copyright 2012 Mozilla Corporation. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 es5id: 9.2.1_8_c_ii 6 description: Tests that values other than strings are not accepted as locales. 7 author: Norbert Lindenberg 8 includes: [testIntl.js] 9 ---*/ 10 11 var notStringOrObject = [undefined, null, true, false, 0, 5, -5, NaN]; 12 13 testWithIntlConstructors(function (Constructor) { 14 notStringOrObject.forEach(function (value) { 15 assert.throws(TypeError, function() { 16 var supported = Constructor.supportedLocalesOf([value]); 17 }, "" + value + " as locale was not rejected."); 18 }); 19 }); 20 21 reportCompare(0, 0);