getStats Future should be strongly typed.
TBR=kevmoo@google.com
Change-Id: I4c4a6376f84b346e676245e5984136adfe3074aa
Reviewed-on: https://dart-review.googlesource.com/62128
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 15ca7bc..97735c9 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -25690,7 +25690,8 @@
List<RtcRtpSender> getSenders() native;
- Future getStats() => promiseToFuture<dynamic>(JS("", "#.getStats()", this));
+ Future<RtcStatsReport> getStats() =>
+ promiseToFuture<RtcStatsReport>(JS("", "#.getStats()", this));
void removeStream(MediaStream stream) native;
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index 1f74820..7b7dabf 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -817,7 +817,7 @@
"PaymentRequestEvent.openWindow": { "type": "WindowClient" },
"RTCPeerConnection.createOffer": { "type": "RtcSessionDescription" },
"RTCPeerConnection.createAnswer": { "type": "RtcSessionDescription" },
- "RTCPeerConnection.getStats": { "type": "dictionary", "maplike": "RTCStatsReport"},
+ "RTCPeerConnection.getStats": { "type": "RtcStatsReport", "maplike": "RTCStatsReport"},
"RTCPeerConnection.generateCertificate": { "type": "RtcCertificate" },
"Permissions.query": { "type": "PermissionStatus" },
"Permissions.request": { "type": "PermissionStatus" },
@@ -1328,15 +1328,19 @@
promiseType = 'Future'
promiseCall = 'promiseToFuture'
if promiseFound is not(None):
+ paramType = promiseFound['type']
if 'maplike' in promiseFound:
- promiseCall = 'promiseToFuture<dynamic>'
- promiseType = 'Future'
- elif promiseFound['type'] == 'dictionary':
+ if paramType == 'dictionary':
+ promiseCall = 'promiseToFuture<dynamic>'
+ promiseType = 'Future'
+ else:
+ promiseCall = 'promiseToFuture<%s>' % paramType
+ promiseType = 'Future<%s>' % paramType
+ elif paramType == 'dictionary':
# It's a dictionary so return as a Map.
promiseCall = 'promiseToFutureAsMap'
promiseType = 'Future<Map<String, dynamic>>'
else:
- paramType = promiseFound['type']
promiseCall = 'promiseToFuture<%s>' % paramType
promiseType = 'Future<%s>' % paramType