| // Copyright 2012 Mozilla Corporation. All rights reserved. |
| // This code is governed by the BSD license found in the LICENSE file. |
| Tests that additional time zone names, if accepted, are handled |
| author: Norbert Lindenberg |
| // canonicalization specified in conformance clause |
| var additionalTimeZoneNames = { |
| "AmErIcA/LoS_aNgElEs": "America/Los_Angeles", |
| Object.getOwnPropertyNames(additionalTimeZoneNames).forEach(function (name) { |
| format = new Intl.DateTimeFormat([], {timeZone: name}); |
| if (error === undefined) { |
| var actual = format.resolvedOptions().timeZone; |
| var expected = additionalTimeZoneNames[name]; |
| if (actual !== expected) { |
| $ERROR("Time zone name " + name + " was accepted, but incorrectly canonicalized to " + |
| actual + "; expected " + expected + "."); |
| } else if (error.name !== "RangeError") { |
| $ERROR("Time zone name " + name + " was rejected with wrong error " + error.name + "."); |