js/src/tests/test262/intl402/ch06/6.4/6.4_a.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:b54d55089fd3
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 * @description Tests that valid time zone names are accepted.
6 * @author Norbert Lindenberg
7 */
8
9 var validTimeZoneNames = [
10 "UTC",
11 "utc" // time zone names are case-insensitive
12 ];
13
14 validTimeZoneNames.forEach(function (name) {
15 // this must not throw an exception for a valid time zone name
16 var format = new Intl.DateTimeFormat(["de-de"], {timeZone: name});
17 if (format.resolvedOptions().timeZone !== name.toUpperCase()) {
18 $ERROR("Time zone name " + name + " was not correctly accepted; turned into " +
19 format.resolvedOptions().timeZone + ".");
20 }
21 });
22

mercurial