-
Notifications
You must be signed in to change notification settings - Fork 83
Fix DDC compilation error for the Dart Debug Extension #1594
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
Conversation
attachDebuggerToTab(tabs[0]); | ||
queryTabs(getCurrentTabQuery, allowInterop((List tabs) { | ||
final tabList = List<Tab>.from(tabs); | ||
if (tabList != null && tabList.isNotEmpty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabList
will never be null here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point!
if (tabs != null && tabs.isNotEmpty) { | ||
attachDebuggerToTab(tabs[0]); | ||
queryTabs(getCurrentTabQuery, allowInterop((List tabs) { | ||
final tabList = List<Tab>.from(tabs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only ever us the first tab, do we need to create the full list for multiple tabs?
if (tabs.isNotEmpty) {
attachDebuggerToTab(tabList.first as Tab);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done!
Also discovered a few other type errors when compiled with DDC, so I've fixed those as well.
@@ -363,7 +364,8 @@ void _forwardMessageToExternalExtensions( | |||
} | |||
|
|||
void _notifyPanelScriptOfChanges(List<DevToolsPanel> panels) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void _notifyPanelScriptOfChanges(List<DevToolsPanel> panels) { | |
void _notifyPanelScriptOfChanges(List panels) { |
Fixes #1506
Explicitly casts our tab list (which the compiler thought was
List<dynamic>
) toList<Tab>
.This is a known limitation of the Dart JS package (https://github.com/dart-lang/sdk/tree/master/pkg/js#list-instances-coming-from-javascript-will-always-be-listdynamic).