Skip to content

Commit 405fffe

Browse files
committed
[GR-62372] Use the canonicalized name when retrieving TimeZone object.
PullRequest: js/3427
2 parents 1f9bc09 + d7052c9 commit 405fffe

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6+
*/
7+
8+
/**
9+
* Regression test of the handling of a non-canonicalized zone-rules-based time zone.
10+
*
11+
* @option js.zone-rules-based-time-zones
12+
*/
13+
14+
load("assert.js");
15+
16+
assertSame('EST', new Intl.DateTimeFormat([], { timeZone: 'EST' }).resolvedOptions().timeZone);

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/nodes/intl/InitializeDateTimeFormatNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private Pair<TimeZone, String> parseAndGetICUTimeZone(String name) {
282282
throw Errors.createRangeErrorInvalidTimeZone(name);
283283
}
284284
tzId = pair.getFirst();
285-
timeZone = IntlUtil.getICUTimeZone(tzId, context);
285+
timeZone = IntlUtil.getICUTimeZone(pair.getSecond(), context);
286286
} else {
287287
timeZone = IntlUtil.getICUTimeZoneForOffset(tzId);
288288
}

0 commit comments

Comments
 (0)