Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _analysis_config/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ environment:
sdk: ^3.1.0

dependencies:
lints: ^4.0.0
lints: ^5.0.0
2 changes: 1 addition & 1 deletion dwds/lib/src/debugging/inspector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ class AppInspector implements AppInspectorInterface {
return _instanceHelper.metadataHelper.isNativeJsError(instanceRef.classRef);
}

/// Request and cache <ScriptRef>s for all the scripts in the application.
/// Request and cache `<ScriptRef>`s for all the scripts in the application.
///
/// This populates [_scriptRefsById], [_scriptIdToLibraryId],
/// [_libraryIdToScriptRefs] and [_serverPathToScriptRef].
Expand Down
4 changes: 2 additions & 2 deletions dwds/lib/src/debugging/metadata/class.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ class ClassMetaData {

/// Type name for Type instances.
///
/// For example, 'int', 'String', 'MyClass', 'List<int>'.
/// For example, `int`, `String`, `MyClass`, `List<int>`.
final String? typeName;

/// The length of the object, if applicable.
final int? length;

/// The dart type name for the object.
///
/// For example, 'int', 'List<String>', 'Null'
/// For example, `int`, `List<String>`, `Null`
String? get dartName => classRef.name;

/// Class ref for the class metadata.
Expand Down
2 changes: 1 addition & 1 deletion dwds/lib/src/services/expression_evaluator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ExpressionEvaluator {
/// Find module path from the XHR call network error message received from chrome.
///
/// Example:
/// NetworkError: Failed to load 'http://<hostname>.com/path/to/module.js?<cache_busting_token>'
/// NetworkError: Failed to load `http://<hostname>.com/path/to/module.js?<cache_busting_token>`
static final _loadModuleErrorRegex =
RegExp(r".*Failed to load '.*\.com/(.*\.js).*");

Expand Down
1 change: 0 additions & 1 deletion dwds/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ dev_dependencies:
frontend_server_common:
path: ../frontend_server_common
js: '>=0.6.4 <0.8.0'
lints: ^4.0.0
pubspec_parse: ^1.2.0
puppeteer: ^3.1.1
stream_channel: ^2.1.2
Expand Down
3 changes: 1 addition & 2 deletions dwds/test/fixtures/project.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'dart:io';

import 'package:path/path.dart' as p;

import 'package:test_common/utilities.dart';

enum IndexBaseMode { noBase, base }
Expand Down Expand Up @@ -48,7 +47,7 @@ class TestProject {
);

/// The URI for the package_config.json is located in:
/// <project directory>/.dart_tool/package_config
/// `<project directory>/.dart_tool/package_config`
Uri get packageConfigFile => p.toUri(
p.join(
absolutePackageDirectory,
Expand Down
26 changes: 14 additions & 12 deletions dwds/web/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,20 @@ Future<void>? main() {

if (dwdsEnableDevToolsLaunch) {
window.onKeyDown.listen((Event e) {
if (e is KeyboardEvent &&
const [
'd',
'D',
'∂', // alt-d output on Mac
'Î', // shift-alt-D output on Mac
].contains(e.key) &&
e.altKey &&
!e.ctrlKey &&
!e.metaKey) {
e.preventDefault();
launchDevToolsJs.callAsFunction();
if (e.isA<KeyboardEvent>()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is almost certainly was NOT working before. Or maybe just not in Wasm?

CC @srujzs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srujzs have we talk about an asA<T> functions that returns T?? (or similar)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e is KeyboardEvent is always returning true regardless of platform because Event and KeyboardEvent have the same representation type, so this was broken. Nice catch!

re: asA, yes. dart-lang/sdk#56957 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest lints catch these for us!

final event = e as KeyboardEvent;
if (const [
'd',
'D',
'∂', // alt-d output on Mac
'Î', // shift-alt-D output on Mac
].contains(event.key) &&
event.altKey &&
!event.ctrlKey &&
!event.metaKey) {
event.preventDefault();
launchDevToolsJs.callAsFunction();
}
}
});
}
Expand Down
1 change: 0 additions & 1 deletion test_common/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ dependencies:
dev_dependencies:
analysis_config:
path: ../_analysis_config
lints: ^4.0.0
pubspec_parse: ^1.2.2
Loading