Skip to content

Commit 864d526

Browse files
authored
Allow Node 17 to pass extra args to inspect. (#1631)
1 parent e3bf3eb commit 864d526

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.49.8
2+
3+
### JS API
4+
5+
* Fix a bug where inspecting the Sass module in the Node.js console crashed on
6+
Node 17.
7+
18
## 1.49.7
29

310
### Embedded Sass

lib/src/import_cache.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ class ImportCache {
130130
.putIfAbsent(Tuple4(url, forImport, baseImporter, baseUrl), () {
131131
var resolvedUrl = baseUrl?.resolveUri(url) ?? url;
132132
var canonicalUrl = _canonicalize(baseImporter, resolvedUrl, forImport);
133-
if (canonicalUrl != null) {
134-
return Tuple3(baseImporter, canonicalUrl, resolvedUrl);
135-
}
133+
if (canonicalUrl == null) return null;
134+
return Tuple3(baseImporter, canonicalUrl, resolvedUrl);
136135
});
137136
if (relativeResult != null) return relativeResult;
138137
}

lib/src/node/reflection.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extension JSClassExtension on JSClass {
6969
/// Sets the custom inspect logic for this class to [body].
7070
void setCustomInspect(String inspect(Object self)) {
7171
setProperty(prototype, _inspectSymbol,
72-
allowInteropCaptureThis((Object self, _, __) => inspect(self)));
72+
allowInteropCaptureThis((Object self, _, __, [___]) => inspect(self)));
7373
}
7474

7575
/// Defines a method with the given [name] and [body].

lib/src/visitor/statement_search.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@ extension _IterableExtension<E> on Iterable<E> {
105105
var value = callback(element);
106106
if (value != null) return value;
107107
}
108+
return null;
108109
}
109110
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.49.7
2+
version: 1.49.8-dev
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)