Skip to content

Commit

Permalink
Cast value correctly in putIfAbsentAsync (#1404)
Browse files Browse the repository at this point in the history
* Cast value correctly in `putIfAbsentAsync`

Fixes #1403

* Update pubspec.yaml

* Update CHANGELOG.md

Co-authored-by: Jennifer Thakar <[email protected]>
  • Loading branch information
Rafer45 and jathak authored Jul 19, 2021
1 parent 4f428ca commit 426277e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.35.3

* No user-facing changes.

## 1.35.2

* **Potentially breaking bug fix**: Properly throw an error for Unicode ranges
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Future<Iterable<F>> mapAsync<E, F>(
/// same key.
Future<V> putIfAbsentAsync<K, V>(
Map<K, V> map, K key, Future<V> ifAbsent()) async {
if (map.containsKey(key)) return map[key]!;
if (map.containsKey(key)) return map[key] as V;
var value = await ifAbsent();
map[key] = value;
return value;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.35.2
version: 1.35.3-dev
description: A Sass implementation in Dart.
author: Sass Team
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit 426277e

Please sign in to comment.