From 5ff434da6a1ebda73f0a91e4bd0ebebc01c50ed9 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Tue, 2 Jul 2019 17:21:05 -0700 Subject: [PATCH] Fix join() and append() $separator error messages Closes #738 --- CHANGELOG.md | 3 +++ lib/src/functions/list.dart | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31732c3d0..e022a81ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ passed a string that contains characters that aren't represented as a single byte in UTF-16. +* Improve the error message for an unknown separator name passed to the `join()` + or `append()` functions. + ## 1.22.2 ### JavaScript API diff --git a/lib/src/functions/list.dart b/lib/src/functions/list.dart index abe4871e7..c683f972b 100644 --- a/lib/src/functions/list.dart +++ b/lib/src/functions/list.dart @@ -63,7 +63,7 @@ final _join = BuiltInCallable( separator = ListSeparator.comma; } else { throw SassScriptException( - '\$$separator: Must be "space", "comma", or "auto".'); + '\$separator: Must be "space", "comma", or "auto".'); } var bracketed = bracketedParam is SassString && bracketedParam.text == 'auto' @@ -91,7 +91,7 @@ final _append = separator = ListSeparator.comma; } else { throw SassScriptException( - '\$$separator: Must be "space", "comma", or "auto".'); + '\$separator: Must be "space", "comma", or "auto".'); } var newList = [...list.asList, value];