Skip to content

Commit addaf9c

Browse files
author
Anna Gringauze
authored
Update temp variable heuristics to catch more cases (#1600)
* Update temp variable heuristics to catch more cases * Format * Update version and build
1 parent 638c89e commit addaf9c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

dwds/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## 14.0.1-dev
22
- Add `libraryFilters` optional parameter to the vm service implememtation
33
of `getSourceReport`.
4+
- Update temp variable detection heuristics so internal JS type objects do
5+
not show in the debugger.
46

57
## 14.0.0
68
- Add column information to breakpoints to allow precise breakpoint placement.

dwds/lib/src/debugging/dart_scope.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'debugger.dart';
1111

1212
// TODO(sdk/issues/44262) - use an alternative way to identify synthetic
1313
// variables.
14-
final ddcTemporaryVariableRegExp = RegExp(r'^(t[0-9]+\$?[0-9]*|__t\$\w*)$');
14+
final ddcTemporaryVariableRegExp = RegExp(r'^(t[0-9]+\$?[0-9]*|__t[\$\w*]+)$');
1515

1616
/// Find the visible Dart properties from a JS Scope Chain, coming from the
1717
/// scopeChain attribute of a Chrome CallFrame corresponding to [frame].

dwds/test/variable_scope_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ void main() {
3939
expect(ddcTemporaryVariableRegExp.hasMatch(r't10'), isTrue);
4040
expect(ddcTemporaryVariableRegExp.hasMatch(r'__t$TL'), isTrue);
4141
expect(ddcTemporaryVariableRegExp.hasMatch(r'__t$StringN'), isTrue);
42+
expect(ddcTemporaryVariableRegExp.hasMatch(r'__t$IdentityMapOfString$T'),
43+
isTrue);
4244

4345
expect(ddcTemporaryVariableRegExp.hasMatch(r't'), isFalse);
4446
expect(ddcTemporaryVariableRegExp.hasMatch(r't10foo'), isFalse);

0 commit comments

Comments
 (0)