Skip to content

Commit

Permalink
Fix dash-insensitivity in get-function() (#795)
Browse files Browse the repository at this point in the history
Closes #792
  • Loading branch information
nex3 committed Aug 14, 2019
1 parent e8a50ac commit 0e5ed4a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.22.10

* Fix a bug in which `get-function()` would fail to find a dash-separated
function when passed a function name with underscores.

## 1.22.9

* Include argument names when reporting range errors and selector parse errors.
Expand Down
6 changes: 4 additions & 2 deletions lib/src/visitor/async_evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,10 @@ class _EvaluateVisitor

var callable = css
? PlainCssCallable(name.text)
: _addExceptionSpan(_callableNode,
() => _getFunction(name.text, namespace: module?.text));
: _addExceptionSpan(
_callableNode,
() => _getFunction(name.text.replaceAll("_", "-"),
namespace: module?.text));
if (callable != null) return SassFunction(callable);

throw "Function not found: $name";
Expand Down
8 changes: 5 additions & 3 deletions lib/src/visitor/evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// DO NOT EDIT. This file was generated from async_evaluate.dart.
// See tool/grind/synchronize.dart for details.
//
// Checksum: c8527e9c89f7ebbab760b62b70da66d1b01b2bf3
// Checksum: fdeda387299e1ad0e9d50f22ae32ab0cf1ff6e30
//
// ignore_for_file: unused_import

Expand Down Expand Up @@ -339,8 +339,10 @@ class _EvaluateVisitor

var callable = css
? PlainCssCallable(name.text)
: _addExceptionSpan(_callableNode,
() => _getFunction(name.text, namespace: module?.text));
: _addExceptionSpan(
_callableNode,
() => _getFunction(name.text.replaceAll("_", "-"),
namespace: module?.text));
if (callable != null) return SassFunction(callable);

throw "Function not found: $name";
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.22.9
version: 1.22.10
description: A Sass implementation in Dart.
author: Sass Team
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit 0e5ed4a

Please sign in to comment.