Skip to content

Commit

Permalink
Produce a better error for positional arguments after named (#1087)
Browse files Browse the repository at this point in the history
Closes #1086
  • Loading branch information
nex3 committed Sep 18, 2020
1 parent 6ec78f9 commit f843f96
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

* Don't crash when writing `Infinity` in JS mode.

* Produce a better error message for positional arguments following named
arguments.

## 1.26.10

* Fixes a bug where two adjacent combinators could cause an error.
Expand Down
4 changes: 3 additions & 1 deletion lib/src/parse/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,9 @@ relase. For details, see http://bit.ly/moz-document.
break;
}
} else if (named.isNotEmpty) {
scanner.expect("...");
error(
"Positional arguments must come before keyword arguments.",
expression.span);
} else {
positional.add(expression);
}
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.26.11-dev
version: 1.26.11
description: A Sass implementation in Dart.
author: Sass Team
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit f843f96

Please sign in to comment.