-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DDC issues in Chrome 86 due to changes in GamepadList #43750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Fox32 - are you using @JS()
library example;
import 'package:js/js.dart';
...
@JS('window.navigator.getGamepads')
List<dynamic> getGamepads();
...
foo() {
List<Gamepad> list = getGamePads().cast<Gamepad>();
...
} |
@sigmundch Good catch, yes we are using it! I first tried to remove that part of the code and the no such method exception is gone! A bit strange is that the exception origins in code that totally not belongs to the code that is working with the gamepads 😆 But I guess that's how the DDC works internally. However this is still a good step, as I can work without gamepad support for now. Second I tried your solution: @JS()
library gamepad_polyfill;
import 'dart:html';
import 'package:js/js.dart';
@JS('window.navigator.getGamepads')
external List<dynamic> _getGamepads();
List<Gamepad> getGamepads() => _getGamepads().cast<Gamepad>(); I put it into a separate library and added the external keyword. However that fails with:
As I'm only interested in the first four values, I decided to go for this workaround for now: @JS()
library gamepad_polyfill;
import 'dart:html';
import 'package:js/js.dart';
import 'package:js/js_util.dart';
@JS('window.navigator.getGamepads')
external dynamic _getGamepads();
List<Gamepad> getGamepads() {
final gamepadList = _getGamepads();
return [
getProperty(gamepadList, '0'),
getProperty(gamepadList, '1'),
getProperty(gamepadList, '2'),
getProperty(gamepadList, '3')
];
} |
…bject's prototype chain. See bugs: * dart-lang/webdev#1133 * #43750 Change-Id: I0daa13ab56be5a2967241a5fcea63a32c0a5cde4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167220 Reviewed-by: Sigmund Cherem <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]> Reviewed-by: Mark Zhou <[email protected]> Commit-Queue: Mark Zhou <[email protected]>
…bject's prototype chain. See bugs: * dart-lang/webdev#1133 * #43750 Change-Id: I0daa13ab56be5a2967241a5fcea63a32c0a5cde4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167220 Reviewed-by: Sigmund Cherem <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]> Reviewed-by: Mark Zhou <[email protected]> Commit-Queue: Mark Zhou <[email protected]>
…bject's prototype chain. See bugs: * dart-lang/webdev#1133 * #43750 Change-Id: I0daa13ab56be5a2967241a5fcea63a32c0a5cde4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167220 Reviewed-by: Sigmund Cherem <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]> Reviewed-by: Mark Zhou <[email protected]> Commit-Queue: Mark Zhou <[email protected]>
What is the status of this? |
I don't think there's been a fix to the API yet. There were other downstream effects of this broken API that affected DDC that were resolved by @Markzipan, but there's only the above workaround for this API for now. |
Maybe this is a P2 now with the work around? If this is still a P1, we should schedule a it in a milestone. |
I'm fine with marking this as P2 for now, that's what we did on the internal facing bug as well. |
This seems to be causing issues in DDC downstream. Here is a sample repro:
The *** line is causing issues. Funny enough, the line itself produces no errors, but if you leave it, you get a nSM on the next line:
/cc @srujzs @nshahan
The text was updated successfully, but these errors were encountered: