Skip to content

Commit cf5a91f

Browse files
srujzselliette
authored andcommitted
Modify JS object check for static interop (dart-lang#1438)
Static interop changes reorganize the type hierarchy such that interop objects are now reified as "LegacyJavaScriptObject".
1 parent f0969bf commit cf5a91f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

dwds/lib/src/debugging/debugger.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -654,12 +654,16 @@ class Debugger extends Domain {
654654
}
655655
}
656656

657-
bool isNativeJsObject(InstanceRef instanceRef) =>
658-
// New type representation of JS objects reifies them to JavaScriptObject.
659-
(instanceRef?.classRef?.name == 'JavaScriptObject' &&
660-
instanceRef?.classRef?.library?.uri == 'dart:_interceptors') ||
661-
// Old type representation still needed to support older SDK versions.
662-
instanceRef?.classRef?.name == 'NativeJavaScriptObject';
657+
bool isNativeJsObject(InstanceRef instanceRef) {
658+
// New type representation of JS objects reifies them to a type suffixed with
659+
// JavaScriptObject.
660+
var className = instanceRef?.classRef?.name;
661+
return (className != null &&
662+
className.endsWith('JavaScriptObject') &&
663+
instanceRef?.classRef?.library?.uri == 'dart:_interceptors') ||
664+
// Old type representation still needed to support older SDK versions.
665+
className == 'NativeJavaScriptObject';
666+
}
663667

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

0 commit comments

Comments
 (0)