mirror of https://github.com/grpc/grpc-dart.git
Use js_util.callMethod rather than calling methods directly on the dynamic javascript types because the resulting code does not work when building web in release mode.
This commit is contained in:
parent
9384f07cdf
commit
5a8818b527
|
@ -179,14 +179,17 @@ class FetchHttpRequest {
|
|||
onErrorController.add(status);
|
||||
}
|
||||
|
||||
final reader = body?.getReader();
|
||||
final stream = body;
|
||||
final reader =
|
||||
stream != null ? js_util.callMethod(stream, 'getReader', []) : null;
|
||||
if (reader == null) {
|
||||
onErrorController.add(0);
|
||||
return;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
final result = await js_util.promiseToFuture(reader.read());
|
||||
final result =
|
||||
await js_util.promiseToFuture(js_util.callMethod(reader, 'read', []));
|
||||
if (_cancelableSend?.isCanceled ?? false) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue