Skip to content

Commit 35d5ca1

Browse files
committed
Dates with missing UTC offset should be interpreted (in nashorn-compat mode) as UTC time when they are "strict" only.
1 parent 66b909f commit 35d5ca1

File tree

1 file changed

+2
-1
lines changed
  • graal-js/src/com.oracle.truffle.js.parser/src/com/oracle/truffle/js/parser/date

1 file changed

+2
-1
lines changed

graal-js/src/com.oracle.truffle.js.parser/src/com/oracle/truffle/js/parser/date/DateParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,8 @@ private boolean patchResult(final boolean strict) {
750750
}
751751

752752
private boolean isUTCDefaultTimezone(boolean dateOnly, boolean strict) {
753-
return (strict || realm.getContext().getLanguageOptions().useUTCForLegacyDates()) && dateOnly;
753+
return realm.getContext().isOptionNashornCompatibilityMode() ? strict :
754+
(dateOnly && (strict || realm.getContext().getLanguageOptions().useUTCForLegacyDates()));
754755
}
755756

756757
private static void addName(final String str, final int type, final int value) {

0 commit comments

Comments
 (0)