Skip to content

Commit 066863d

Browse files
committed
Add tests to integer.ts and fix shiftLeft and shiftRight
1 parent 56d396f commit 066863d

File tree

2 files changed

+1027
-2
lines changed

2 files changed

+1027
-2
lines changed

core/src/integer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ class Integer {
634634
shiftLeft (numBits: number | Integer): Integer {
635635
let bitsCount = Integer.toNumber(numBits)
636636
if ((bitsCount &= 63) === 0) {
637-
return this
637+
return Integer.ZERO
638638
} else if (bitsCount < 32) {
639639
return Integer.fromBits(
640640
this.low << bitsCount,
@@ -655,7 +655,7 @@ class Integer {
655655
let bitsCount: number = Integer.toNumber(numBits)
656656

657657
if ((bitsCount &= 63) === 0) {
658-
return this
658+
return Integer.ZERO
659659
} else if (numBits < 32) {
660660
return Integer.fromBits(
661661
(this.low >>> bitsCount) | (this.high << (32 - bitsCount)),

0 commit comments

Comments
 (0)