[dart2wasm] Override runtime types of internal types
Runtime types of String, int, and double implementations are expected to be `String`, `int`, and `double`, respectively. Change-Id: I8f84ee2e8405c820a686d54449d3eb2db18eb52a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276643 Commit-Queue: Ömer Ağacan <omersa@google.com> Reviewed-by: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
committed by
Commit Queue
parent
419df9d3e5
commit
181c9962b1
@@ -63,6 +63,9 @@ class _BoxedDouble extends double {
|
||||
/// Dummy factory to silence error about missing superclass constructor.
|
||||
external factory _BoxedDouble();
|
||||
|
||||
@override
|
||||
Type get runtimeType => double;
|
||||
|
||||
static const int _mantissaBits = 52;
|
||||
static const int _exponentBits = 11;
|
||||
static const int _exponentBias = 1023;
|
||||
|
||||
@@ -31,6 +31,9 @@ class _BoxedInt extends int {
|
||||
/// Dummy factory to silence error about missing superclass constructor.
|
||||
external factory _BoxedInt();
|
||||
|
||||
@override
|
||||
Type get runtimeType => int;
|
||||
|
||||
external num operator +(num other);
|
||||
external num operator -(num other);
|
||||
external num operator *(num other);
|
||||
|
||||
@@ -95,6 +95,9 @@ abstract class _StringBase implements String {
|
||||
|
||||
_StringBase._();
|
||||
|
||||
@override
|
||||
Type get runtimeType => String;
|
||||
|
||||
int get hashCode {
|
||||
int hash = _getHash(this);
|
||||
if (hash != 0) return hash;
|
||||
|
||||
Reference in New Issue
Block a user