Skip to content

Commit 47b70d5

Browse files
committed
Implement Int64 as a wrapper for int when targeting native and Wasm
This PR adds another `Int64` implementation that is just a wrapper around `int`, to be used in targets where `int` is 64 bits. Becuase `dart doc` generates using the native class, all documentation comments are moved to the native class. The conditional import is implemented based on availability of the library `dart:html`, which is only available on dart2js. Improves #172. It could be further improved by having `Int64` as an extension class when targeting native and Wasm, but that would be a breaking change.
1 parent 5c3e2c3 commit 47b70d5

File tree

10 files changed

+1649
-1659
lines changed

10 files changed

+1649
-1659
lines changed

pkgs/fixnum/lib/fixnum.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
/// Signed 32- and 64-bit integer support.
66
///
77
/// The integer implementations in this library are designed to work
8-
/// identically whether executed on the Dart VM or compiled to JavaScript.
9-
library;
8+
/// identically whether executed on the Dart VM or compiled to JavaScript or
9+
/// Wasm.
10+
library fixnum;
1011

1112
export 'src/int32.dart';
1213
export 'src/int64.dart';

pkgs/fixnum/lib/src/int32.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,6 @@ class Int32 implements IntX {
321321
return Int32(value);
322322
}
323323

324-
/// Returns [:true:] if this [Int32] has the same numeric value as the
325-
/// given object. The argument may be an [int] or an [IntX].
326324
@override
327325
bool operator ==(Object other) {
328326
if (other is Int32) {

0 commit comments

Comments
 (0)