Skip to content

Commit 8a9006a

Browse files
committed
Merge branch 'main' into yj-dartdevembedder-4
2 parents c781e5f + 6465541 commit 8a9006a

File tree

10 files changed

+40
-19
lines changed

10 files changed

+40
-19
lines changed

dwds/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Update to be forward compatible with changes to `package:shelf_web_socket`.
44
- Added support for some debugging APIs with the DDC library bundle format. - [#2537](https://github.com/dart-lang/webdev/issues/2537),[#2544](https://github.com/dart-lang/webdev/issues/2544)
55

6+
67
## 24.2.0
78

89
- Consolidate `FrontendServerDdcStrategyProvider` and `FrontendServerRequireStrategyProvider` under a shared parent class. - [#2517](https://github.com/dart-lang/webdev/issues/2517)

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/patterns_inspection_common.dart

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'package:test/test.dart';
66
import 'package:test_common/logging.dart';
77
import 'package:test_common/test_sdk_configuration.dart';
8+
import 'package:test_common/utilities.dart';
89
import 'package:vm_service/vm_service.dart';
910

1011
import '../../fixtures/context.dart';
@@ -96,11 +97,24 @@ void runTests({
9697
await onBreakPoint('testPatternCase2', (event) async {
9798
final frame = event.topFrame!;
9899

99-
expect(await getFrameVariables(frame), {
100-
'obj': matchListInstance(type: 'Object'),
101-
'a': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
102-
'n': matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
103-
});
100+
if (dartSdkIsAtLeast('3.7.0-246.0.dev')) {
101+
expect(await getFrameVariables(frame), {
102+
'obj': matchListInstance(type: 'Object'),
103+
// Renamed to avoid shadowing variables from previous case.
104+
'a\$':
105+
matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
106+
'n\$':
107+
matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
108+
});
109+
} else {
110+
expect(await getFrameVariables(frame), {
111+
'obj': matchListInstance(type: 'Object'),
112+
// Renamed to avoid shadowing variables from previous case.
113+
'a': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
114+
'n':
115+
matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
116+
});
117+
}
104118
});
105119
});
106120

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

webdev/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 3.7.1-wip
2+
13
## 3.7.0
24

35
- Update `dwds` constraint to `24.2.0`.

webdev/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webdev/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: webdev
22
# Every time this changes you need to run `dart run build_runner build`.
3-
version: 3.7.0
3+
version: 3.7.1-wip
44
# We should not depend on a dev SDK before publishing.
55
# publish_to: none
66
description: >-

0 commit comments

Comments
 (0)