Skip to content

Commit

Permalink
[vm] Use correct static type for the port mapping in Dart
Browse files Browse the repository at this point in the history
The keys in the map are integers.

TEST=Existing test suite.

Change-Id: I989a8be01f3abb6b50f0c0d692b84c1494a60ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206542
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
  • Loading branch information
mkustermann authored and commit-bot@chromium.org committed Jul 13, 2021
1 parent ca57dfa commit 723df3d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/lib/_internal/vm/lib/isolate_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ class _RawReceivePortImpl implements RawReceivePort {
}

/**** Internal implementation details ****/
_get_id() native "RawReceivePortImpl_get_id";
_get_sendport() native "RawReceivePortImpl_get_sendport";
int _get_id() native "RawReceivePortImpl_get_id";
SendPort _get_sendport() native "RawReceivePortImpl_get_sendport";

// Called from the VM to retrieve the handler for a message.
@pragma("vm:entry-point", "call")
Expand All @@ -186,7 +186,7 @@ class _RawReceivePortImpl implements RawReceivePort {
}

// Call into the VM to close the VM maintained mappings.
_closeInternal() native "RawReceivePortImpl_closeInternal";
int _closeInternal() native "RawReceivePortImpl_closeInternal";

// Set this port as active or inactive in the VM. If inactive, this port
// will not be considered live even if it hasn't been explicitly closed.
Expand All @@ -195,7 +195,7 @@ class _RawReceivePortImpl implements RawReceivePort {
_setActive(bool active) native "RawReceivePortImpl_setActive";

void set handler(Function? value) {
final id = this._get_id();
final int id = this._get_id();
if (!_portMap.containsKey(id)) {
_portMap[id] = <String, dynamic>{
'port': this,
Expand All @@ -204,7 +204,7 @@ class _RawReceivePortImpl implements RawReceivePort {
_portMap[id]!['handler'] = value;
}

static final _portMap = <dynamic, Map<String, dynamic>>{};
static final _portMap = <int, Map<String, dynamic>>{};
}

@pragma("vm:entry-point")
Expand Down

0 comments on commit 723df3d

Please sign in to comment.