Skip to content

Commit 498184a

Browse files
committed
updated function name and comments
1 parent 951e72b commit 498184a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

dwds/lib/src/debugging/dart_runtime_debugger.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class DartRuntimeDebugger {
210210
String libraryUri,
211211
String methodName,
212212
) {
213-
String findLibraryExpression() => '''
213+
final findLibraryExpression = '''
214214
(function() {
215215
const sdk = ${_loadStrategy.loadModuleSnippet}('dart_sdk');
216216
const dart = sdk.dart;
@@ -220,8 +220,11 @@ class DartRuntimeDebugger {
220220
})();
221221
''';
222222

223+
// `callLibraryMethod` expects an array of arguments. Chrome DevTools spreads
224+
// arguments individually when calling functions. This code reconstructs the
225+
// expected argument array.
223226
return _generateJsExpression(
224-
findLibraryExpression(),
227+
findLibraryExpression,
225228
_wrapWithBundleLoader(
226229
'',
227230
'callLibraryMethod("$libraryUri", "$methodName", Array.from(arguments))',

dwds/lib/src/debugging/inspector.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,11 @@ class AppInspector implements AppInspectorInterface {
303303
List<RemoteObject> arguments,
304304
) {
305305
return globalToolConfiguration.loadStrategy is DdcLibraryBundleStrategy
306-
? _evaluateWithDdcLibraryBundle(library, selector, arguments)
306+
? _evaluateLibraryMethodWithDdcLibraryBundle(
307+
library,
308+
selector,
309+
arguments,
310+
)
307311
: _evaluateInLibrary(
308312
library,
309313
'function () { return this.$selector.apply(this, arguments); }',
@@ -351,10 +355,10 @@ class AppInspector implements AppInspectorInterface {
351355
return jsCallFunctionOn(remoteLibrary, jsFunction, arguments);
352356
}
353357

354-
/// Evaluates the specified method [methodName] in the context of [library]
358+
/// Evaluates the specified top-level method [methodName] within [library]
355359
/// using the Dart Development Compiler (DDC) library bundle strategy with
356360
/// the given [arguments].
357-
Future<RemoteObject> _evaluateWithDdcLibraryBundle(
361+
Future<RemoteObject> _evaluateLibraryMethodWithDdcLibraryBundle(
358362
Library library,
359363
String methodName,
360364
List<RemoteObject> arguments,

0 commit comments

Comments
 (0)