Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 889fea3

Browse files
committed
Properly map function names with named arguments.
[email protected] Review URL: https://codereview.chromium.org//2069043004 .
1 parent 0a9cc8b commit 889fea3

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.5
2+
3+
* Add compatibility for member names that include named arguments.
4+
15
## 1.0.4
26

37
* Add compatibility for Dart 1.10-style name munging.

lib/source_map_stack_trace.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ String _prettifyMember(String member) {
8484
return member
8585
// Get rid of the noise that Firefox sometimes adds.
8686
.replaceAll(new RegExp(r"/?<$"), "")
87-
// Get rid of arity indicators.
88-
.replaceAll(new RegExp(r"\$\d+$"), "")
87+
// Get rid of arity indicators and named arguments.
88+
.replaceAll(new RegExp(r"\$\d+(\$[a-zA-Z_0-9]+)*$"), "")
8989
// Convert closures to <fn>.
9090
.replaceAllMapped(new RegExp(r"(_+)closure\d*\.call$"),
9191
// The number of underscores before "closure" indicates how nested it

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: source_map_stack_trace
2-
version: 1.0.4
2+
version: 1.0.5
33
description: >
44
A package for applying source maps to stack traces.
55
author: Dart Team <[email protected]>

test/source_map_stack_trace_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ foo.dart.js 10:11 baz
153153
expect(_prettify(r"foo$1234"), equals("foo"));
154154
});
155155

156+
test("named arguments", () {
157+
expect(_prettify(r"foo$1$bar"), equals("foo"));
158+
expect(_prettify(r"foo$123$bar$bang$qux"), equals("foo"));
159+
});
160+
156161
test("closures", () {
157162
expect(_prettify("foo_closure.call"), equals("foo.<fn>"));
158163
});

0 commit comments

Comments
 (0)