Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Change back to Object from dynamic #66

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## 1.9.4-dev

* Added support for firefox anonymous stack traces
* Change the argument type to `Chain.capture` from `Function(dynamic, Chain)` to
`Function(Object, Chain)`. Existing functions which take `dynamic` are still
fine, but new uses can have a safer type.

## 1.9.3

Expand Down
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ analyzer:
implicit-casts: false
errors:
prefer_spread_collections: ignore

linter:
rules:
- avoid_private_typedef_functions
2 changes: 1 addition & 1 deletion lib/src/chain.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Chain implements StackTrace {
///
/// If [callback] returns a value, it will be returned by [capture] as well.
static T capture<T>(T Function() callback,
{void Function(dynamic error, Chain) onError,
{void Function(Object error, Chain) onError,
bool when = true,
bool errorZone = true}) {
if (!errorZone && onError != null) {
Expand Down
5 changes: 1 addition & 4 deletions lib/src/stack_zone_specification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import 'lazy_trace.dart';
import 'trace.dart';
import 'utils.dart';

/// A function that handles errors in the zone wrapped by [Chain.capture].
typedef _ChainHandler = void Function(dynamic error, Chain chain);

/// A class encapsulating the zone specification for a [Chain.capture] zone.
///
/// Until they're materialized and exposed to the user, stack chains are tracked
Expand Down Expand Up @@ -56,7 +53,7 @@ class StackZoneSpecification {
///
/// If this is null, that indicates that any unhandled errors should be passed
/// to the parent zone.
final _ChainHandler _onError;
final void Function(Object error, Chain) _onError;

/// The most recent node of the current stack chain.
_Node _currentNode;
Expand Down