Skip to content

Commit

Permalink
Don't try to cast an error to JsError
Browse files Browse the repository at this point in the history
Dart's runtime understanding of what a "JsError" is isn't sufficient
to make sense of everything that might be thrown by, for example, a
custom function with an error.
  • Loading branch information
nex3 committed Jan 16, 2021
1 parent e97dd1a commit f93feaf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.32.5

### JS API

* Avoid possible mangled error messages when custom functions or importers throw
unexpected exceptions.

## 1.32.4

* No user-visible changes.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ void main() {
///
/// [render]: https://github.com/sass/node-sass#options
void _render(
RenderOptions options, void callback(JsError error, RenderResult result)) {
RenderOptions options, void callback(Object error, RenderResult result)) {
if (options.fiber != null) {
options.fiber.call(allowInterop(() {
try {
callback(null, _renderSync(options));
} catch (error) {
callback(error as JsError, null);
callback(error, null);
}
return null;
})).run();
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.32.4
version: 1.32.5
description: A Sass implementation in Dart.
author: Sass Team
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit f93feaf

Please sign in to comment.