Skip to content

Commit 784fc6e

Browse files
authored
Remove dead code for reading events from console (#1483)
The `'dart.developer.registerExtension'` and `'dart.developer.postEvent'` events from the chrome console. These messages haven't been written to the console since dwds v11.1.0 and Dart SDK v2.14.0. Fixes: #1342
1 parent a75f8ef commit 784fc6e

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

dwds/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- Fix a bug where `dartEmitDebugEvents` was set as a `String` instead of `bool`
99
in the injected client.
1010
- Emit a warning instead of crashing on missing `libraries.json`.
11+
- Remove dead code for reading `'dart.developer.registerExtension'` and
12+
`'dart.developer.postEvent'` events from the chrome console. These messages
13+
haven't been written to the console since dwds v11.1.0 and Dart SDK v2.14.0.
1114

1215
**Breaking changes:**
1316

dwds/lib/src/services/chrome_proxy_service.dart

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -876,32 +876,9 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
876876
if (isolateRef.id != isolate.id) return;
877877

878878
var firstArgValue = event.args[0].value as String;
879-
// TODO(grouma) - Remove when the min SDK has updated to migrate users
880-
// over to the injected client communication approach.
879+
// TODO(nshahan) - Migrate 'inspect' and 'log' events to the injected
880+
// client communication approach as well?
881881
switch (firstArgValue) {
882-
case 'dart.developer.registerExtension':
883-
var service = event.args[1].value as String;
884-
isolate.extensionRPCs.add(service);
885-
_streamNotify(
886-
EventStreams.kIsolate,
887-
Event(
888-
kind: EventKind.kServiceExtensionAdded,
889-
timestamp: DateTime.now().millisecondsSinceEpoch,
890-
isolate: isolateRef)
891-
..extensionRPC = service);
892-
break;
893-
case 'dart.developer.postEvent':
894-
_streamNotify(
895-
EventStreams.kExtension,
896-
Event(
897-
kind: EventKind.kExtension,
898-
timestamp: DateTime.now().millisecondsSinceEpoch,
899-
isolate: isolateRef)
900-
..extensionKind = event.args[1].value as String
901-
..extensionData = ExtensionData.parse(
902-
jsonDecode(event.args[2].value as String)
903-
as Map<String, dynamic>));
904-
break;
905882
case 'dart.developer.inspect':
906883
// All inspected objects should be real objects.
907884
if (event.args[1].type != 'object') break;

0 commit comments

Comments
 (0)