Skip to content

Commit

Permalink
Clarify the error for the wrong number of positional arguments
Browse files Browse the repository at this point in the history
Closes #776
  • Loading branch information
nex3 committed Jul 25, 2019
1 parent d408a59 commit d840b84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

* Avoid double `Error:` headers when reporting selector parse errors.

* Clarify the error message when the wrong number of positional arguments are
passed along with a named argument.

## 1.22.8

### JavaScript API
Expand Down
1 change: 1 addition & 0 deletions lib/src/ast/sass/argument_declaration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class ArgumentDeclaration implements SassNode {

if (positional > arguments.length) {
throw SassScriptException("Only ${arguments.length} "
"${names.isEmpty ? '' : 'positional '}"
"${pluralize('argument', arguments.length)} allowed, but "
"${positional} ${pluralize('was', positional, plural: 'were')} "
"passed.");
Expand Down

0 comments on commit d840b84

Please sign in to comment.