| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library source_map_stack_trace; | 5 library source_map_stack_trace; |
| 6 | 6 |
| 7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
| 8 import 'package:source_maps/source_maps.dart'; | 8 import 'package:source_maps/source_maps.dart'; |
| 9 import 'package:stack_trace/stack_trace.dart'; | 9 import 'package:stack_trace/stack_trace.dart'; |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // is. | 94 // is. |
| 95 (match) => ".<fn>" * match[1].length) | 95 (match) => ".<fn>" * match[1].length) |
| 96 // Get rid of explicitly-generated calls. | 96 // Get rid of explicitly-generated calls. |
| 97 .replaceAll(new RegExp(r"\.call$"), "") | 97 .replaceAll(new RegExp(r"\.call$"), "") |
| 98 // Get rid of the top-level method prefix. | 98 // Get rid of the top-level method prefix. |
| 99 .replaceAll(new RegExp(r"^dart\."), "") | 99 .replaceAll(new RegExp(r"^dart\."), "") |
| 100 // Get rid of library namespaces. | 100 // Get rid of library namespaces. |
| 101 .replaceAll(new RegExp(r"[a-zA-Z_0-9]+\$"), "") | 101 .replaceAll(new RegExp(r"[a-zA-Z_0-9]+\$"), "") |
| 102 // Get rid of the static method prefix. The class name also exists in the | 102 // Get rid of the static method prefix. The class name also exists in the |
| 103 // invocation, so we're not getting rid of any information. | 103 // invocation, so we're not getting rid of any information. |
| 104 .replaceAll(new RegExp(r"^[a-zA-Z_0-9]+.static."), "") | 104 .replaceAll(new RegExp(r"^[a-zA-Z_0-9]+.(static|dart)."), "") |
| 105 // Convert underscores after identifiers to dots. This runs the risk of | 105 // Convert underscores after identifiers to dots. This runs the risk of |
| 106 // incorrectly converting members that contain underscores, but those are | 106 // incorrectly converting members that contain underscores, but those are |
| 107 // contrary to the style guide anyway. | 107 // contrary to the style guide anyway. |
| 108 .replaceAllMapped(new RegExp(r"([a-zA-Z0-9]+)_"), | 108 .replaceAllMapped(new RegExp(r"([a-zA-Z0-9]+)_"), |
| 109 (match) => match[1] + "."); | 109 (match) => match[1] + "."); |
| 110 } | 110 } |
| OLD | NEW |