Skip to content

Commit 219cedb

Browse files
committed
addressed comment
1 parent 188f8df commit 219cedb

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

dwds/lib/src/debugging/dart_runtime_debugger.dart

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ class DartRuntimeDebugger {
108108
return _wrapInIIFE(expression);
109109
}
110110

111-
/// Generates a JS expression for retrieving extension names.
112-
String getExtensionNamesJsExpression() {
111+
/// Generates a JS expression for retrieving Dart Developer Extension Names.
112+
String getDartDeveloperExtensionNamesJsExpression() {
113113
return _generateJsExpression(
114114
"${_loadStrategy.loadModuleSnippet}('dart_sdk').developer._extensions.keys.toList();",
115115
'dartDevEmbedder.debugger.extensionNames',
116116
);
117117
}
118118

119-
/// Generates a JS expression for retrieving library metadata.
120-
String getLibraryMetadataJsExpression(String libraryUri) {
119+
/// Generates a JS expression for retrieving metadata of classes in a library.
120+
String getClassesInLibraryJsExpression(String libraryUri) {
121121
final expression = _buildExpression(
122122
'',
123123
"getLibraryMetadata('$libraryUri')",
@@ -136,10 +136,14 @@ class DartRuntimeDebugger {
136136
);
137137
}
138138

139-
/// Generates a JS expression for dynamically loading an object's field.
140-
String dloadReplJsExpression(String fieldName) {
139+
/// Generates a JS expression for getting a property from a JS object.
140+
String getPropertyJsExpression(String fieldName) {
141141
return _generateJsExpression(
142-
_wrapWithSdkLoader('', 'dloadRepl(this, "$fieldName")'),
142+
'''
143+
function() {
144+
return this["$fieldName"];
145+
}
146+
''',
143147
'''
144148
function() {
145149
return this["$fieldName"];

dwds/lib/src/debugging/inspector.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class AppInspector implements AppInspectorInterface {
193193
@override
194194
Future<RemoteObject> loadField(RemoteObject receiver, String fieldName) {
195195
final load = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
196-
.dloadReplJsExpression(fieldName);
196+
.getPropertyJsExpression(fieldName);
197197
return jsCallFunctionOn(receiver, load, []);
198198
}
199199

@@ -746,7 +746,7 @@ class AppInspector implements AppInspectorInterface {
746746
/// Runs an eval on the page to compute all existing registered extensions.
747747
Future<List<String>> _getExtensionRpcs() async {
748748
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
749-
.getExtensionNamesJsExpression();
749+
.getDartDeveloperExtensionNamesJsExpression();
750750
final extensionRpcs = <String>[];
751751
final params = {
752752
'expression': expression,

dwds/lib/src/debugging/libraries.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class LibraryHelper extends Domain {
8383
if (libraryId == null || libraryUri == null) return null;
8484
// Fetch information about all the classes in this library.
8585
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
86-
.getLibraryMetadataJsExpression(libraryUri);
86+
.getClassesInLibraryJsExpression(libraryUri);
8787

8888
RemoteObject? result;
8989
try {

dwds/test/instances/common/instance_inspection_common.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023-2024, the Dart project authors. Please see the AUTHORS file
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

dwds/test/instances/instance_inspection_amd_canary_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020-2024, the Dart project authors. Please see the AUTHORS file
1+
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

dwds/test/instances/instance_inspection_amd_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020-2024, the Dart project authors. Please see the AUTHORS file
1+
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

0 commit comments

Comments
 (0)