Skip to content

Commit

Permalink
Revert "Alternate fix for JVM breakage to PR #4189"
Browse files Browse the repository at this point in the history
bartolin++ figured out that it was actually missing deconts on the
JVM backend that caused problems.  So add them.

This reverts commit f627ccb
  • Loading branch information
lizmat committed Feb 1, 2021
1 parent f627ccb commit 0f5272c
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions src/core.c/DateTime.pm6
Expand Up @@ -173,34 +173,22 @@ my class DateTime does Dateish {
%extra,
--> DateTime:D) {
self!oor("Month",$month,"1..12")
#?if jvm
unless 1 <= $month <= 12;
#?endif
#?if !jvm
if nqp::islt_I($month,1) || nqp::isgt_I($month,12);
#?endif
if nqp::islt_I(nqp::decont($month),1)
|| nqp::isgt_I(nqp::decont($month),12);

my $DIM := self!DAYS-IN-MONTH($year,$month);
self!oor("Day",$day,"1..$DIM")
#?if jvm
unless 1 <= $day <= $DIM;
#?endif
#?if !jvm
if nqp::islt_I($day,1) || nqp::isgt_I($day,$DIM);
#?endif
if nqp::islt_I(nqp::decont($day),1)
|| nqp::isgt_I(nqp::decont($day),$DIM);

self!oor("Hour",$hour,"0..23")
#?if jvm
unless 0 <= $hour <= 23;
#?endif
#?if !jvm
if nqp::islt_I($hour,0) || nqp::isgt_I($hour,23);
#?endif
if nqp::islt_I(nqp::decont($hour),0)
|| nqp::isgt_I(nqp::decont($hour),23);

self!oor("Minute",$minute,"0..59")
#?if jvm
unless 0 <= $minute <= 59;
#?endif
#?if !jvm
if nqp::islt_I($minute,0) || nqp::isgt_I($minute,59);
#?endif
if nqp::islt_I(nqp::decont($minute),0)
|| nqp::isgt_I(nqp::decont($minute),59);

(^61).in-range($second,'Second'); # some weird semantics need this

my $dt := nqp::eqaddr(self.WHAT,DateTime)
Expand Down

0 comments on commit 0f5272c

Please sign in to comment.