Skip to content

Commit

Permalink
Allow Node 17 to pass extra args to inspect. (#1631)
Browse files Browse the repository at this point in the history
  • Loading branch information
Awjin committed Feb 17, 2022
1 parent e3bf3eb commit 864d526
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
## 1.49.8

### JS API

* Fix a bug where inspecting the Sass module in the Node.js console crashed on
Node 17.

## 1.49.7

### Embedded Sass
Expand Down
5 changes: 2 additions & 3 deletions lib/src/import_cache.dart
Expand Up @@ -130,9 +130,8 @@ class ImportCache {
.putIfAbsent(Tuple4(url, forImport, baseImporter, baseUrl), () {
var resolvedUrl = baseUrl?.resolveUri(url) ?? url;
var canonicalUrl = _canonicalize(baseImporter, resolvedUrl, forImport);
if (canonicalUrl != null) {
return Tuple3(baseImporter, canonicalUrl, resolvedUrl);
}
if (canonicalUrl == null) return null;
return Tuple3(baseImporter, canonicalUrl, resolvedUrl);
});
if (relativeResult != null) return relativeResult;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/node/reflection.dart
Expand Up @@ -69,7 +69,7 @@ extension JSClassExtension on JSClass {
/// Sets the custom inspect logic for this class to [body].
void setCustomInspect(String inspect(Object self)) {
setProperty(prototype, _inspectSymbol,
allowInteropCaptureThis((Object self, _, __) => inspect(self)));
allowInteropCaptureThis((Object self, _, __, [___]) => inspect(self)));
}

/// Defines a method with the given [name] and [body].
Expand Down
1 change: 1 addition & 0 deletions lib/src/visitor/statement_search.dart
Expand Up @@ -105,5 +105,6 @@ extension _IterableExtension<E> on Iterable<E> {
var value = callback(element);
if (value != null) return value;
}
return null;
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,5 +1,5 @@
name: sass
version: 1.49.7
version: 1.49.8-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit 864d526

Please sign in to comment.