[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:
Ömer Sinan Ağacan
2022-12-20 14:27:56 +00:00
committed by Commit Queue
parent 419df9d3e5
commit 181c9962b1
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -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;
+3
View File
@@ -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;