Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be strict about whitespace in custom functions #1848

Merged
merged 2 commits into from Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,20 @@
## 1.56.3

### JavaScript API

* **Potentially breaking bug fix**: Custom functions in both the modern and
legacy API now properly reject signatures with whitespace between the function
name and parentheses.

* Custom functions in the legacy API now allow signatures with whitespace before
the function name, to match a bug in Node Sass.

### Dart API

* **Potentially breaking bug fix**: `Callable.parseSignature()` and
nex3 marked this conversation as resolved.
Show resolved Hide resolved
`AsyncCallable.parseSignature()` now reject signatures with whitespace between
the function name and parentheses.

## 1.56.2

### Embedded Sass
Expand Down
2 changes: 1 addition & 1 deletion lib/src/node/legacy.dart
Expand Up @@ -210,7 +210,7 @@ List<AsyncCallable> _parseFunctions(RenderOptions options, DateTime start,

var fiber = options.fiber;
if (fiber != null) {
result.add(Callable.fromSignature(signature, (arguments) {
result.add(Callable.fromSignature(signature.trimLeft(), (arguments) {
nex3 marked this conversation as resolved.
Show resolved Hide resolved
var currentFiber = fiber.current;
var jsArguments = [
...arguments.map(wrapValue),
Expand Down
1 change: 0 additions & 1 deletion lib/src/parse/stylesheet.dart
Expand Up @@ -147,7 +147,6 @@ abstract class StylesheetParser extends Parser {
{bool requireParens = true}) {
return wrapSpanFormatException(() {
var name = identifier();
whitespace();
var arguments = requireParens || scanner.peekChar() == $lparen
? _argumentDeclaration()
: ArgumentDeclaration.empty(scanner.emptySpan);
Expand Down
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -9,5 +9,8 @@
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"intercept-stdout": "^0.1.2"
},
"dependencies": {
"node-sass": "^8.0.0"
nex3 marked this conversation as resolved.
Show resolved Hide resolved
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,5 +1,5 @@
name: sass
version: 1.56.2
version: 1.56.3-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down