Skip to content

Commit e3cc92b

Browse files
iamstoliskassifar
authored andcommitted
Dates with missing UTC offset should be interpreted (in nashorn-compat mode) as UTC time when they are "strict" only.
(cherry picked from commit 35d5ca1)
1 parent bf261b4 commit e3cc92b

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
@@ -746,7 +746,8 @@ private boolean patchResult(final boolean strict) {
746746
}
747747

748748
private boolean isUTCDefaultTimezone(boolean dateOnly, boolean strict) {
749-
return (strict || realm.getContext().getLanguageOptions().useUTCForLegacyDates()) && dateOnly;
749+
return realm.getContext().isOptionNashornCompatibilityMode() ? strict :
750+
(dateOnly && (strict || realm.getContext().getLanguageOptions().useUTCForLegacyDates()));
750751
}
751752

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

0 commit comments

Comments
 (0)