Skip to content

Modify JS object check for static interop #1438

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

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions dwds/lib/src/debugging/debugger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,16 @@ class Debugger extends Domain {
}
}

bool isNativeJsObject(InstanceRef instanceRef) =>
// New type representation of JS objects reifies them to JavaScriptObject.
(instanceRef?.classRef?.name == 'JavaScriptObject' &&
instanceRef?.classRef?.library?.uri == 'dart:_interceptors') ||
// Old type representation still needed to support older SDK versions.
instanceRef?.classRef?.name == 'NativeJavaScriptObject';
bool isNativeJsObject(InstanceRef instanceRef) {
// New type representation of JS objects reifies them to a type suffixed with
// JavaScriptObject.
var className = instanceRef?.classRef?.name;
return (className != null &&
className.endsWith('JavaScriptObject') &&
instanceRef?.classRef?.library?.uri == 'dart:_interceptors') ||
// Old type representation still needed to support older SDK versions.
className == 'NativeJavaScriptObject';
}

/// Returns the Dart line number for the provided breakpoint.
int _lineNumberFor(Breakpoint breakpoint) =>
Expand Down