Skip to content

Commit 29c2613

Browse files
authored
Modify JS object check for static interop (#1438)
Static interop changes reorganize the type hierarchy such that interop objects are now reified as "LegacyJavaScriptObject".
1 parent bf751c1 commit 29c2613

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
@@ -652,12 +652,16 @@ class Debugger extends Domain {
652652
}
653653
}
654654

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

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

0 commit comments

Comments
 (0)