Allow Node 17 to pass extra args to inspect. (#1631)

This commit is contained in:
Awjin Ahn 2022-02-16 16:38:56 -08:00 committed by GitHub
parent e3bf3eb3a3
commit 864d526715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 5 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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].

View File

@ -105,5 +105,6 @@ extension _IterableExtension<E> on Iterable<E> {
var value = callback(element);
if (value != null) return value;
}
return null;
}
}

View File

@ -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